/* Base styles */
:root {
    --primary-blue: #16a34a;
    --border-gray: #e5e7eb;
    --text-dark: #1f2937;
    --text-gray: #4b5563;
    --fancy-font: 'Playfair Display', serif;
    --body-font: 'Poppins', sans-serif;
    --heading-font: 'Montserrat', sans-serif;
}

.para{
    color:rgb(13, 228, 171);
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
}

/* Form Elements */
.invalid-input { border-color: red; }

.warning-message {
    color: red;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Navigation */
.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
    font-family: var(--body-font);
    font-size: 1.1rem;
}

.nav-link:hover { color: var(--primary-blue); }

/* Select Inputs Shared Styles */
.grade-select, 
#foreignLanguage, 
#re {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 0.4rem 0.5rem;
    width: 100%;
    appearance: none;
    font-size: 0.8125rem;
    font-weight: 500;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2316a34a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.4rem center;
    background-repeat: no-repeat;
    background-size: 1.125em 1.125em;
    transition: all 0.25s ease;
    min-height: 32px;
    padding-right: 24px;
}

@media (min-width: 640px) {
    .grade-select, 
    #foreignLanguage, 
    #re {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        min-height: 38px;
        padding-right: 30px;
        background-position: right 0.5rem center;
        background-size: 1.25em 1.25em;
    }
}

/* Select States */
.grade-select:hover,
#foreignLanguage:hover,
#re:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.1);
}

.grade-select:focus,
#foreignLanguage:focus,
#re:focus {
    border-color: var(--primary-blue);
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15), 0 0 20px rgba(22, 163, 74, 0.1);
}

/* Subject Form Styling */
#subjectForm {
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    border-radius: 0.75rem;
}

@media (min-width: 640px) {
    #subjectForm {
        padding: 1.5rem;
    }
}

/* Group Headers */
.mb-6 h3.font-bold {
    color: var(--primary-blue);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-gray);
    margin-bottom: 1rem;
}

/* Subject Groups Color Coding */
#subjectForm div:nth-of-type(1) .grade-select { border-left: 3px solid #f4f41b; }
#subjectForm div:nth-of-type(2) .grade-select { border-left: 3px solid #10b981; }
#subjectForm div:nth-of-type(3) .grade-select { border-left: 3px solid #f5520d; }
#subjectForm div:nth-of-type(4) .grade-select { border-left: 3px solid #52e745; }
#subjectForm div:nth-of-type(5) .grade-select { border-left: 3px solid #f53ac6; }

/* Select Options Styling */
select option[value=""] { color: #e71815; }
select option:not([value=""]) { color: var(--text-dark); }

/* Enhanced Mobile Select Styling */
@media (max-width: 640px) {
    /* Make selects more compact on mobile */
    .grade-select,
    .cc-grade-select,
    select.grade-select,
    #foreignLanguage,
    #re {
        font-size: 13px !important;
        padding: 5px 26px 5px 8px !important;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        line-height: 1.2 !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        background-size: 14px !important;
        background-position: right 6px center !important;
    }
    
    /* Force smaller native dropdown options */
    .grade-select option,
    .cc-grade-select option,
    select option {
        font-size: 13px !important;
        padding: 6px 8px !important;
        min-height: unset !important;
        line-height: 1.3 !important;
    }
    
    /* Subject grid items tighter spacing */
    .cc-grade-item,
    .subject-item {
        margin-bottom: 0.5rem !important;
    }
    
    /* Tighter subject labels */
    .cc-grade-item label,
    .subject-label {
        font-size: 0.75rem !important;
        margin-bottom: 0.25rem !important;
    }
}

/* Even smaller screens */
@media (max-width: 400px) {
    .grade-select,
    .cc-grade-select,
    select.grade-select,
    #foreignLanguage,
    #re {
        font-size: 12px !important;
        padding: 4px 22px 4px 6px !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
    }
    
    .grade-select option,
    .cc-grade-select option,
    select option {
        font-size: 12px !important;
        padding: 5px 6px !important;
    }
}

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

#results.show {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .mobile-menu { display: none; }
    .mobile-menu.active { display: block; }
    
    #subjectForm { padding: 1rem; }
    
    .grid.md\:grid-cols-4,
    .grid.md\:grid-cols-3,
    .grid.md\:grid-cols-2 {
        gap: 1rem;
    }
}

/* Add this to your existing CSS */
select option:hover,
select option:focus {
    background-color: #16a34a !important; /* matches your --primary-blue variable */
    color: white !important;
}

/* For better cross-browser support */
select option:checked,
select option:active {
    background-color: #16a34a !important;
    color: white !important;
}

/* Results Section Styling */
#results {
    transition: all 0.3s ease-out;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
}

.cluster-card {
    transition: all 0.2s ease-in-out;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem !important;
}

.cluster-card:hover {
    transform: translateY(-2px);
    border-color: #f719b1;
}

.cluster-card h4 {
    font-size: 0.9rem !important;
    color: #e1199e !important;
}

/* Progress bar animation */
@keyframes progressFill {
    from { width: 0; }
    to { width: 100%; }
}

.progress-bar-fill {
    animation: progressFill 1.5s ease-out forwards;
    background: linear-gradient(to right, #4dce6b, #0befef) !important;
}

.cluster-card .bg-green-100 {
    background-color: rgba(6, 182, 212, 0.1) !important;
}

.cluster-card .text-green-700 {
    color: #eb21b2 !important;
    font-size: 1rem !important;
}

/* Adjust grid layout */
#results .grid {
    gap: 0.75rem !important;
}

/* Staggered fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Add staggered delay for each card */
.cluster-card:nth-child(1) { animation-delay: 0.1s; }
.cluster-card:nth-child(2) { animation-delay: 0.2s; }
.cluster-card:nth-child(3) { animation-delay: 0.3s; }
.cluster-card:nth-child(4) { animation-delay: 0.4s; }
/* ... add more if needed */

/* Hamburger menu styles */
.hamburger-menu {
    padding: 0.5rem;
    cursor: pointer;
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #374151;
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

/* Active state for hamburger menu */
.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu Styles */
.mobile-menu {
    display: none;
    width: 100%;
    z-index: 50;
}

.mobile-menu.show {
    display: block;
}

/* Hamburger Menu Styles */
.hamburger-menu {
    cursor: pointer;
    padding: 10px;
}

.hamburger-menu span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #000;
    margin: 4px 0;
    transition: all 0.3s ease;
}

/* Active State */
.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (min-width: 768px) {
    .mobile-menu {
        display: none !important;
    }
}

/* Font Families */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--fancy-font);
    transition: all 0.3s ease;
}

h1 {
    font-size: 3.5rem !important;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Interactive Text Animations */
.animate-text {
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

.animate-text:hover {
    transform: translateY(-2px);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Fancy Hover Effects for Links */
.nav-link {
    font-family: var(--body-font);
    font-size: 1.1rem;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background-color: var(--primary-blue);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Enhanced Form Elements */
.grade-select, 
#foreignLanguage, 
#re {
    font-family: var(--body-font);
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

/* Results Section Enhancement */
.cluster-card {
    font-family: var(--body-font);
}

.cluster-card h4 {
    font-family: var(--fancy-font);
    font-size: 1.2rem !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cluster-card:hover h4 {
    transform: scale(1.05);
    color: #d946ef !important;
}

/* Text Gradient Effect */
.gradient-text {
    background: linear-gradient(45deg, #16a34a, #0ea5e9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem !important;
    }
    
    .grade-select, 
    #foreignLanguage, 
    #re {
        font-size: 1rem;
    }
}

/* Preloader */
#preloader {
    transition: opacity 0.8s ease-out;
    background: linear-gradient(to bottom right, #ffffff, #f0fdf4);
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #16a34a;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-top: 1rem;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Different reveal animations */
.reveal-left {
    transform: translateX(-100px);
}

.reveal-right {
    transform: translateX(100px);
}

.reveal-delay-1 {
    transition-delay: 0.2s;
}

.reveal-delay-2 {
    transition-delay: 0.4s;
}

.reveal-delay-3 {
    transition-delay: 0.6s;
}

/* Preloader text animations */
.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-in forwards;
}

.animate-fade-in-delay {
    opacity: 0;
    animation: fadeIn 0.8s ease-in forwards 0.3s;
}

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

/* Optional: Add a nice shadow effect to the text */
#preloader h1, #preloader h2 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Add these new styles for the print button and animation */
@keyframes flash {
    0%, 100% { 
        background-color: #16a34a;
        transform: scale(1);
    }
    50% { 
        background-color: #22c55e;
        transform: scale(1.05);
    }
}

.print-button {
    animation: flash 2s infinite;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(22, 163, 74, 0.3);
}

.print-button:hover {
    animation: none;
    transform: scale(1.05);
    background-color: #15803d;
}

@media print {
    body * {
        visibility: hidden;
    }
    #results, #results * {
        visibility: visible;
    }
    #results {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .no-print {
        display: none !important;
    }
}