:root {
    --primary: #16645D;
    --secondary: #0D8C06;
    --accent: #059C97;
    --light: #e0f7fa;
    --dark: #1a1a1a;
    --white: #ffffff;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Playfair+Display:wght@700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background-image: url('../images/app2.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--dark);
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    z-index: -1;
}

.header {
    padding: 25px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--gradient);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.header::after {
    content: '';
    position: absolute;
    width: 150%;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(-5deg) translateY(-50%);
    top: 50%;
    left: -25%;
}

.header-logo, .header img {
    max-width: 180px;
    height: auto;
    z-index: 1;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
    transition: var(--transition);
}

.header-logo:hover, .header img:hover {
    transform: scale(1.05) rotate(2deg);
}

.hero-section {
    text-align: center;
    padding: 30px 20px;
    margin: 0 auto;
    max-width: 1200px;
}

.hero-image {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin: 20px auto;
    transition: var(--transition);
    border: 5px solid var(--white);
}

.hero-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 1.8rem;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--accent);
    border-radius: 3px;
}

.title-arabic {
    font-family: 'Tajawal', sans-serif;
    font-size: 2.2rem;
    color: var(--primary);
    margin: 10px 0 30px;
    direction: rtl;
    font-weight: 700;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    line-height: 1.8;
}

.faculties-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 30px auto;
    padding: 0 20px;
    max-width: 1200px;
    gap: 30px;
}

.faculty-card {
    background-color: var(--white);
    border-radius: 15px;
    padding: 30px;
    width: 100%;
    max-width: 300px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.faculty-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient);
}

.faculty-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.faculty-link {
    color: var(--primary);
    text-decoration: none;
    display: block;
    height: 100%;
}

.faculty-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--accent);
    transition: var(--transition);
}

.faculty-card:hover .faculty-icon {
    transform: scale(1.2);
    color: var(--primary);
}

.faculty-card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.faculty-card h2::after {
    width: 50px;
}

.faculty-card p {
    color: var(--dark);
    font-weight: 600;
    margin-top: 10px;
}

/* Styles pour le système d'onglets */
.announcement-container {
    background: var(--white);
    border-radius: 15px;
    padding: 30px;
    margin: 30px auto;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    max-width: 900px;
}

.announcement-title {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary);
    font-size: 2rem;
}

.language-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.language-tab {
    padding: 12px 25px;
    background: none;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    color: #888;
    position: relative;
}

.language-tab.active {
    color: var(--primary);
}

.language-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
}

.language-tab:hover {
    color: var(--primary);
}

.language-content {
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.language-content.active {
    display: block;
}

.announcement-content {
    line-height: 1.8;
}

.announcement-section {
    margin-bottom: 30px;
}

.announcement-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
    text-align: left;
    font-size: 1.3rem;
    border-bottom: 2px solid var(--light);
    padding-bottom: 8px;
}

.announcement-list {
    padding-left: 20px;
    margin: 15px 0;
}

.announcement-list li {
    margin-bottom: 10px;
    position: relative;
}

.announcement-list li::before {
    content: '•';
    color: var(--accent);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

#ar-content .announcement-list {
    padding-right: 20px;
    padding-left: 0;
}

#ar-content .announcement-list li::before {
    margin-right: -1em;
    margin-left: 0;
}

/* Styles pour le tableau des spécialités */
.specialties-container {
    background: var(--white);
    border-radius: 15px;
    padding: 30px;
    margin: 30px auto;
    box-shadow: var(--shadow);
    max-width: 1000px;
}

.specialties-title {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
    font-size: 1.8rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    padding-bottom: 10px;
}

.specialties-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--accent);
    border-radius: 3px;
}

.specialties-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9em;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.specialties-table thead tr {
    background: var(--gradient);
    color: var(--white);
    text-align: left;
    font-weight: bold;
}

.specialties-table th,
.specialties-table td {
    padding: 15px 18px;
    text-align: left;
    border-bottom: 1px solid #dddddd;
}

.specialties-table tbody tr {
    transition: var(--transition);
}

.specialties-table tbody tr:nth-of-type(even) {
    background-color: #f8f8f8;
}

.specialties-table tbody tr:last-of-type {
    border-bottom: 3px solid var(--primary);
}

.specialties-table tbody tr:hover {
    background-color: rgba(5, 156, 151, 0.1);
    transform: translateX(5px);
}

.specialties-table .faculty-cell {
    font-weight: 600;
    color: var(--primary);
}

.specialties-table .places-cell {
    text-align: center;
    font-weight: bold;
    color: var(--secondary);
}

.table-responsive {
    overflow-x: auto;
    margin: 0 auto;
}

.specialties-note {
    text-align: center;
    margin-top: 20px;
    font-style: italic;
    color: #666;
}

.note-box {
    background: #fff9e6;
    border-left: 4px solid #ffcc00;
    padding: 20px;
    margin: 25px auto;
    border-radius: 8px;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

.access-button {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 40px auto;
    padding: 18px 30px;
    text-align: center;
    background: var(--gradient);
    color: var(--white);
    border: none;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.2em;
    font-weight: bold;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(5, 156, 151, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.access-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    z-index: -1;
    transition: opacity 0.4s ease;
    opacity: 0;
}

.access-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(5, 156, 151, 0.4);
}

.access-button:hover::before {
    opacity: 1;
}

.university-badge {
    text-align: center;
    margin: 40px auto;
    padding: 15px;
    max-width: 300px;
    border-top: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
}

.university-badge p {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Styles pour les formulaires */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary);
}

.form-input, .form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus, .form-select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 156, 151, 0.2);
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 40px;
    color: #999;
}

.submit-button, .login-button {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--gradient);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.submit-button::before, .login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    z-index: -1;
    transition: opacity 0.4s ease;
    opacity: 0;
}

.submit-button:hover, .login-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(5, 156, 151, 0.4);
}

.submit-button:hover::before, .login-button:hover::before {
    opacity: 1;
}

.submit-note {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

/* Styles pour la page d'inscription */
.registration-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

.registration-header {
    text-align: center;
    margin-bottom: 30px;
}

.registration-title {
    font-family: 'Tajawal', sans-serif;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
    direction: rtl;
}

.registration-subtitle {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 30px;
}

.registration-form {
    background: var(--white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.result-container {
    display: none;
    background: var(--white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease forwards;
}

.success-icon {
    font-size: 4rem;
    color: var(--secondary);
    margin-bottom: 20px;
}

.credentials-display {
    background: var(--light);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.credential-item {
    margin-bottom: 15px;
}

.credential-label {
    font-weight: bold;
    color: var(--primary);
}

.credential-value {
    color: var(--accent);
    font-size: 1.2rem;
    margin-top: 5px;
    word-break: break-all;
}

.instruction-text {
    margin: 20px 0;
    line-height: 1.6;
}

/* Styles pour la page de connexion */
.login-container, .login-main-container {
    max-width: 500px;
    margin: 30px auto;
    padding: 0 20px;
}

.login-main-container {
    max-width: 1200px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-title {
    font-family: 'Tajawal', sans-serif;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
    direction: rtl;
}

.login-subtitle {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 30px;
}

.login-form {
    background: var(--white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.login-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.login-announcement {
    background: var(--white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 800px;
    width: 100%;
}

.announcement-text {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.2rem;
    color: var(--primary);
    line-height: 1.8;
    direction: rtl;
}

.login-form-container {
    background: var(--white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow);
    max-width: 400px;
    width: 100%;
}

.login-links {
    text-align: center;
    margin-top: 20px;
}

.login-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    margin: 0 10px;
}

.login-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.alert-message {
    display: none;
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border-left: 4px solid #c62828;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated {
    animation: fadeIn 1s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }

/* Responsive Design */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .title-arabic { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    
    .announcement-container, .specialties-container {
        padding: 20px 15px;
    }
    
    .language-tab {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .specialties-table {
        font-size: 0.8em;
    }
    
    .specialties-table th,
    .specialties-table td {
        padding: 12px 10px;
    }
    
    .access-button {
        padding: 15px 15px;
        font-size: 1.1em;
    }
    
    .registration-form, .login-form, .login-announcement, .login-form-container {
        padding: 20px;
    }
    
    .registration-title, .login-title {
        font-size: 1.7rem;
    }
    
    .registration-subtitle, .login-subtitle {
        font-size: 1.3rem;
    }
    
    .announcement-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .header img, .header-logo {
        max-width: 140px;
    }
    
    h1 { font-size: 1.8rem; }
    .title-arabic { font-size: 1.5rem; }
    
    .hero-image {
        max-width: 100%;
    }
    
    .language-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .language-tab {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
    
    .specialties-table {
        font-size: 0.7em;
    }
    
    .specialties-table th,
    .specialties-table td {
        padding: 8px 5px;
    }
    
    .registration-title, .login-title {
        font-size: 1.5rem;
    }
    
    .registration-subtitle, .login-subtitle {
        font-size: 1.1rem;
    }
    
    .success-icon {
        font-size: 3rem;
    }
    
    .announcement-text {
        font-size: 1rem;
    }
    
    .login-links {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}