/* Custom CSS for Class 3 Exam Website */

/* Global Styles */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* Fluid Container */
.container-fluid {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0.5rem;
}

@media (min-width: 640px) {
    .container-fluid {
        padding: 0 1rem;
    }
}

@media (min-width: 768px) {
    .container-fluid {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container-fluid {
        padding: 0 2rem;
    }
}

@media (min-width: 1280px) {
    .container-fluid {
        padding: 0 3rem;
    }
}

/* Fluid Grid System */
.fluid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

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

.fluid-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Fluid Typography */
.fluid-text {
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
    line-height: 1.6;
}

.fluid-heading {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    line-height: 1.2;
}

.fluid-subheading {
    font-size: clamp(1.25rem, 3vw, 1.875rem);
    line-height: 1.3;
}

/* Today's Content Layout */
#date-content .grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
    align-items: center;
}

#date-content .col-span-2 {
    grid-column: span 2;
}

#date-content .col-span-10 {
    grid-column: span 10;
}

/* Mobile responsive for Today's Content */
@media (max-width: 768px) {
    #date-content .col-span-2,
    #date-content .col-span-10 {
        grid-column: span 12;
    }
    
    #date-content .col-span-2 {
        margin-bottom: 1rem;
    }
}

/* Hero Slider Styles */
.hero-slider {
    position: relative;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
}

.slider-dot.active {
    background-color: white !important;
    transform: scale(1.2);
}

.slider-prev,
.slider-next {
    z-index: 3;
    backdrop-filter: blur(10px);
}

.slider-prev:hover,
.slider-next:hover {
    backdrop-filter: blur(15px);
}

/* Hero Slider Responsive */
@media (max-width: 768px) {
    .slider-prev,
    .slider-next {
        display: none;
    }
    
    .hero-slide {
        padding: 2rem 0;
    }
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 1024px) {
    .container-fluid {
        padding: 0 1rem;
    }
    
    .fluid-heading {
        font-size: clamp(1.25rem, 3.5vw, 2rem);
    }
    
    .fluid-subheading {
        font-size: clamp(1rem, 2.5vw, 1.5rem);
    }
    
    .fluid-text {
        font-size: clamp(0.8rem, 2vw, 1rem);
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 0 0.75rem;
    }
    
    /* Mobile Navigation */
    .lg\\:hidden {
        display: block !important;
    }
    
    .hidden.lg\\:block {
        display: none !important;
    }
    
    /* Mobile Header Height */
    .h-20 {
        height: 4rem;
    }
    
    /* Mobile Logo */
    .h-12 {
        height: 2.5rem;
    }
    
    /* Mobile Button Spacing */
    .space-x-3 > * + * {
        margin-left: 0.5rem;
    }
    
    /* Mobile Grid Adjustments */
    .fluid-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .fluid-grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .fluid-grid-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .container-fluid {
        padding: 0 0.5rem;
    }
    
    /* Extra small mobile adjustments */
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .py-2\\.5 {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    /* Mobile menu improvements */
    .px-4 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .py-3 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

/* Selected Date Display */
.selected-date-display {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.selected-date-display:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Calendar Selection State */
.calendar-day.selected {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
    transform: scale(1.05);
}

.calendar-day.selected:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: scale(1.1);
}

/* Date Display Animation */
#current-date {
    transition: all 0.3s ease;
}

#current-date.updating {
    opacity: 0.7;
    transform: scale(0.95);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #22c55e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #16a34a;
}

/* Calendar Styles */
.calendar-container {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.calendar-nav {
    background: #22c55e;
    color: white;
    border: none;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.875rem;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-nav:hover {
    background: #16a34a;
}

.calendar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    flex: 1;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.125rem;
    width: 100%;
    max-width: 100%;
    min-height: 250px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: #6b7280;
    padding: 0.375rem 0.25rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day {
    min-height: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    position: relative;
    border: 1px solid transparent;
    aspect-ratio: 1;
}

.calendar-day:hover {
    background: #f0fdf4;
}

.calendar-day.today {
    background: #22c55e;
    color: white;
    font-weight: 600;
}

.calendar-day.other-month {
    color: #d1d5db;
}

.calendar-day.has-events {
    background: #dcfce7;
    color: #166534;
    font-weight: 500;
}

/* Category Cards */
.category-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #22c55e;
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.category-description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Article Cards */
.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-content {
    padding: 1.5rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.article-category {
    background: #dcfce7;
    color: #166534;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-excerpt {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more {
    color: #22c55e;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
}

.read-more:hover {
    color: #16a34a;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #22c55e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Modal Styles */
.modal {
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: #22c55e;
    color: white;
}

.btn-primary:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #22c55e;
    border: 2px solid #22c55e;
}

.btn-secondary:hover {
    background: #f0fdf4;
}

/* Responsive Design */
@media (max-width: 640px) {
    .calendar-container {
        padding: 0.5rem;
    }
    
    .calendar-header {
        margin-bottom: 0.5rem;
    }
    
    .calendar-title {
        font-size: 0.875rem;
    }
    
    .calendar-nav {
        padding: 0.25rem;
        min-width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .calendar-grid {
        gap: 0.1rem;
        min-height: 200px;
    }
    
    .calendar-day-header {
        padding: 0.25rem 0.125rem;
        font-size: 0.625rem;
    }
    
    .calendar-day {
        min-height: 24px;
        height: 24px;
        font-size: 0.625rem;
    }
    
    .category-card {
        padding: 0.75rem;
    }
    
    .article-content {
        padding: 0.75rem;
    }
    
    .article-title {
        font-size: 1rem;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .calendar-day {
        min-height: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .calendar-grid {
        min-height: 280px;
    }
}

@media (min-width: 769px) {
    .calendar-day {
        min-height: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
    
    .calendar-grid {
        min-height: 320px;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-content {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .print-header {
        border-bottom: 2px solid #22c55e;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    
    .print-questions {
        margin-top: 2rem;
        page-break-before: always;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

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

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

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

/* Fluid Layout Utilities */
.w-full {
    width: 100% !important;
}

.h-full {
    height: 100% !important;
}

.min-h-screen {
    min-height: 100vh;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-x-hidden {
    overflow-x: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

/* Responsive Text */
.text-responsive {
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
}

.text-responsive-lg {
    font-size: clamp(1.125rem, 4vw, 2rem);
}

.text-responsive-xl {
    font-size: clamp(1.5rem, 5vw, 3rem);
}

/* Responsive Spacing */
.p-responsive {
    padding: clamp(0.5rem, 2vw, 2rem);
}

.m-responsive {
    margin: clamp(0.5rem, 2vw, 2rem);
}

/* Grid Responsive */
.grid-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(1rem, 3vw, 2rem);
}

/* Calendar Responsive */
.calendar-responsive {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.calendar-responsive .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: clamp(0.125rem, 0.5vw, 0.25rem);
    width: 100%;
    max-width: 100%;
}

.calendar-responsive .calendar-day {
    aspect-ratio: 1;
    min-height: clamp(24px, 4vw, 40px);
    height: clamp(24px, 4vw, 40px);
    font-size: clamp(0.625rem, 1.5vw, 0.875rem);
}

/* Chart Styles */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container canvas {
    max-height: 300px !important;
    width: 100% !important;
}

/* Admin Dashboard Styles */
.admin-chart-container {
    position: relative;
    height: 250px;
    width: 100%;
    margin-bottom: 1rem;
}

.admin-chart-container canvas {
    max-height: 250px !important;
    width: 100% !important;
}

/* Analytics Chart Styles */
.analytics-chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    margin-bottom: 2rem;
}

.analytics-chart-container canvas {
    max-height: 400px !important;
    width: 100% !important;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, #22c55e, #16a34a) 1;
}

/* Dropdown Styles */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    min-width: 200px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease-in-out;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
}

.dropdown-item:hover {
    background-color: #f9fafb;
    color: #111827;
}

.dropdown-item i {
    margin-right: 0.75rem;
    width: 16px;
    text-align: center;
}

/* Admin Dropdown Specific Styles */
#notificationDropdown,
#userDropdown {
    z-index: 9999;
}

#notificationDropdown {
    width: 320px;
    max-width: 90vw;
}

#userDropdown {
    width: 192px;
}
