/* Base Styles & Variables */
:root {
    --primary-color: #2b6cb0;
    --secondary-color: #2c5282;
    --accent-color: #e53e3e;
    --text-color: #2d3748;
    --text-light: #4a5568;
    --light-gray: #f7fafc;
    --white: #ffffff;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-gray);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: white;
    box-shadow: var(--shadow);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e2e8f0;
    animation: slideInDown 0.5s var(--ease-in-out);
    will-change: transform, opacity;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 50px;
    width: auto;
    border-radius: var(--border-radius);
}

.logo h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.logo p {
    margin: 0.2rem 0 0 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

.whatsapp-btn {
    background-color: #25D366;
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.whatsapp-btn:hover {
    background-color: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 5rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s var(--ease-in-out);
    will-change: transform, opacity;
}

.hero-content {
    position: relative;
    z-index: 2;
    animation: fadeIn 1s var(--ease-in-out) 0.2s both;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHBhdHRlcm5UcmFuc2Zvcm09InJvdGF0ZSgzMCkiPjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjA1KSI+PC9yZWN0PjwvcGF0dGVybj48L2RlZnM+PHJlY3QgZmlsbD0idXJsKCNwYXR0ZXNuKSIgaGVpZ2h0PSIxMDAlIiB3aWR0aD0iMTAwJSI+PC9yZWN0Pjwvc3ZnPg==');
    opacity: 0.3;
    pointer-events: none;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
    position: relative;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero p {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 2.5rem;
    opacity: 0.95;
    line-height: 1.6;
    position: relative;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 0.9rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: none;
    cursor: pointer;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    z-index: -1;
}

.cta-button:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.cta-button:hover::before {
    width: 100%;
    right: auto;
    left: 0;
}

/* Section Title */
.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 50px;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    border-radius: 3px;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background-color: white;
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(43, 108, 176, 0.03) 0%, rgba(229, 62, 62, 0.03) 100%);
    z-index: 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.feature-card {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid #edf2f7;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: white;
    z-index: 1;
    animation: fadeIn 0.6s var(--ease-in-out) forwards;
    will-change: transform, opacity, box-shadow;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

.feature-card:hover::before {
    height: 6px;
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    background: rgba(43, 108, 176, 0.1);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.feature-card h3 {
    color: var(--primary-color);
    margin: 0.5rem 0 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

/* Grades Section */
.grades {
    padding: 4rem 0;
    background-color: #f8fafc;
    position: relative;
    overflow: hidden;
}

.grades::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.02) 0%, rgba(43, 108, 176, 0.02) 100%);
    z-index: 0;
}

.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.grade-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.6s var(--ease-in-out) forwards;
    will-change: transform, opacity, box-shadow;
}

.grade-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: var(--transition);
}

.grade-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

.grade-card:hover::before {
    height: 6px;
}

.grade-card h3 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin: 0;
    padding: 1rem;
    font-size: 1.1rem;
    text-align: center;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.grade-card ul {
    list-style: none;
    padding: 1.25rem;
    margin: 0;
    display: grid;
    gap: 0.5rem;
    flex-grow: 1;
}

.grade-card li {
    padding: 0.6rem 0.75rem;
    border-radius: 4px;
    background-color: #f8fafc;
    color: var(--text-color);
    display: flex;
    align-items: center;
    transition: var(--transition);
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.grade-card li::before {
    content: '•';
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.5rem;
    margin-left: 0.5rem;
    line-height: 1;
}

.grade-card li:hover {
    transform: translateX(-3px);
    background-color: #f0f4f8;
}

.grade-card li:last-child {
    border-bottom: none;
}

/* Subscription Form */
.subscription {
    padding: 4rem 0;
    background-color: white;
    position: relative;
}

.subscription::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.form-container {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    z-index: 1;
    animation: fadeIn 0.6s var(--ease-in-out) forwards;
    will-change: transform, opacity, box-shadow;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.subscription-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Form group styling */
.form-group {
    margin-bottom: 0;
    width: 100%;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: #f8fafc;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
    outline: none;
    background-color: white;
}

/* Responsive adjustments for form rows */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-container {
        padding: 1.75rem 1.5rem;
    }
}

.form-container:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.form-description {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
}

.subscription-form .form-group {
    margin-bottom: 0;
    width: 100%;
}

/* Make form inputs and selects full width */
.form-group input,
.form-group select {
    width: 100%;
    box-sizing: border-box;
}

/* Style for the subjects container to span full width */
#subjects-container,
#selected-subjects,
.total-amount {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}

.total-amount {
    background-color: #f8fafc;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    border: 1px dashed #cbd5e0;
    text-align: center;
    margin-top: 0.5rem;
}

.total-amount label {
    margin-right: 0.5rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Submit button styling */
.submit-btn {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    font-family: 'Tajawal', sans-serif;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(43, 108, 176, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Loading state for submit button */
.submit-btn.loading {
    pointer-events: none;
    opacity: 0.9;
}

.submit-btn .btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}

.submit-btn.loading .btn-spinner {
    display: inline-block;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.subscription-form input[type="text"],
.subscription-form input[type="tel"],
.subscription-form input[type="email"],
.subscription-form select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    transition: var(--transition);
    background-color: #f8fafc;
    color: var(--text-color);
}

.subscription-form input:focus,
.subscription-form select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.1);
    background-color: white;
}

.subjects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.subject-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 0.95rem;
}

.subject-option:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.subject-option.selected {
    background-color: #f0fdf4;
    border-color: #86efac;
    color: #166534;
    font-weight: 500;
}

.selected-subjects {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selected-subject {
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subject-label {
    flex: 1;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-color);
    transition: var(--transition);
}

.subject-option:hover .subject-label {
    color: var(--secondary-color);
}

.no-grade-selected {
    color: #999;
    text-align: center;
    width: 100%;
    margin: auto;
}

.total-amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    padding: 15px 0;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: block;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(26, 54, 93, 0.15);
    animation: fadeIn 0.6s var(--ease-in-out) forwards;
    will-change: transform, opacity, box-shadow;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    transition: all 0.4s ease;
    z-index: -1;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(26, 54, 93, 0.2);
}

.submit-btn:hover::before {
    width: 100%;
    right: auto;
    left: 0;
}

.submit-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(26, 54, 93, 0.15);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 3.5rem 0 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    padding: 2.5rem 0 1.5rem;
    position: relative;
    font-size: 0.95rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHBhdHRlcm5UcmFuc2Zvcm09InJvdGF0ZSgzMCkiPjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjAzKSI+PC9yZWN0PjwvcGF0dGVybj48L2RlZnM+PHJlY3QgZmlsbD0idXJsKCNwYXR0ZXJuKSIgaGVpZ2h0PSIxMDAlIiB3aWR0aD0iMTAwJSI+PC9yZWN0Pjwvc3ZnPg==');
    opacity: 0.6;
    pointer-events: none;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2.5rem;
    position: relative;
}

.footer-logo {
    text-align: center;
}

.footer-logo img {
    height: 45px;
    width: auto;
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
    opacity: 0.9;
}

.footer-logo img:hover {
    transform: translateY(-3px) scale(1.05);
    opacity: 1;
    filter: brightness(0) invert(1) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    margin: 0;
    padding: 0.5rem 0;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.25s ease;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    position: relative;
    white-space: nowrap;
    border-radius: 4px;
}

.footer-links a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.footer-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    right: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease, right 0.3s ease;
}

.footer-links a:hover::after {
    width: 100%;
    right: 0;
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

.social-links a {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    font-size: 1.1rem;
}

.social-links a:hover {
    background: var(--accent-color);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.footer-bottom {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    line-height: 1.5;
}

.footer-bottom p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.footer-bottom a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer-bottom a:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Form specific responsive adjustments */
@media (max-width: 600px) {
    .form-container {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grade-card {
        padding: 20px;
    }
    
    /* Optimize animations for mobile */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
            scroll-behavior: auto !important;
        }
    }
}

/* Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(43, 108, 176, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(43, 108, 176, 0); }
    100% { box-shadow: 0 0 0 0 rgba(43, 108, 176, 0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--ease-in-out), transform 0.6s var(--ease-in-out);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Delay Classes */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* Tooltip Styles */
.tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: var(--shadow-md);
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent;
}

/* Subject Option Animation */
.subject-option {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.subject-option.selected {
    animation: pulse 0.5s ease;
}

/* Form Field Focus Styles */
input:not([type="checkbox"]):focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.2);
    outline: none;
}

/* Loading Animation for Buttons */
@keyframes buttonLoading {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.button-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: buttonLoading 0.8s linear infinite;
}

.feature-card,
.grade-card,
.form-container {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

/* Success Message */
.success-message,
.error-message {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
    position: relative;
    overflow: hidden;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.error-message {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.success-message::before,
.error-message::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
}

.success-message::before {
    background-color: #22c55e;
}

.error-message::before {
    background-color: #ef4444;
}

/* Offers Section */
.offers {
    padding: 4rem 0;
    background-color: var(--white);
}

.offers .section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.offer-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    height: 320px; /* Increased height for better content visibility */
    aspect-ratio: 4/5; /* Rectangular aspect ratio matching image dimensions */
}

.offer-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.offer-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Show full image content without cropping */
    display: block;
    transition: var(--transition);
}

.offer-card:hover .offer-image {
    transform: scale(1.02);
}

/* Responsive Design for Offers */
@media (max-width: 768px) {
    .offers {
        padding: 2rem 0;
    }
    
    .offers .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .offers-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .offer-card {
        margin: 0 10px;
        height: 280px; /* Slightly smaller height on mobile */
    }
}

/* Modal/Lightbox for Offer Images */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
    display: block;
    animation: zoomIn 0.3s ease-out;
}

.modal-image {
    width: 100%;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: var(--transition);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover,
.close:focus {
    color: #ccc;
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile Modal Adjustments */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        max-height: 85vh;
    }
    
    .close {
        top: 10px;
        right: 15px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
}

/* Modal Navigation Buttons */
.modal-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 1002;
}

.modal-nav-btn {
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
    pointer-events: auto;
    opacity: 0.8;
}

.modal-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    opacity: 1;
    transform: scale(1.1);
}

.modal-nav-btn:active {
    transform: scale(0.95);
}

.modal-nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.modal-nav-btn.disabled:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: none;
}

/* Position navigation buttons */
.prev-btn {
    transform: translateY(-50%);
}

.next-btn {
    transform: translateY(-50%);
}

/* Mobile Navigation Adjustments */
@media (max-width: 768px) {
    .modal-nav {
        padding: 0 10px;
    }
    
    .modal-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}
