/* ===================================
   Mobile Responsive Enhancements
   All pages optimized for mobile devices
   =================================== */

/* ===================================
   Splash Screen Mobile
   =================================== */
@media (max-width: 768px) {
    #splash-screen {
        padding: 20px;
    }
    
    #splash-screen .logo {
        width: 100px !important;
        height: 100px !important;
    }
    
    #splash-screen h1 {
        font-size: 24px !important;
    }
    
    #splash-screen p {
        font-size: 14px !important;
    }
}

/* ===================================
   Admin Login Mobile
   =================================== */
@media (max-width: 768px) {
    .admin-login-container {
        padding: 20px;
        display: flex;
        align-items: center;
        min-height: 100vh;
    }
    
    .admin-login-box {
        width: 100%;
        max-width: 100%;
        padding: 30px 20px;
        margin: 0;
    }
    
    .admin-logo img {
        width: 60px !important;
        height: 60px !important;
    }
    
    .admin-logo h2 {
        font-size: 24px;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .form-group input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px;
    }
    
    .btn {
        padding: 14px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .admin-login-box {
        padding: 25px 15px;
    }
    
    .admin-logo h2 {
        font-size: 20px;
    }
}

/* ===================================
   Admin Panel Mobile
   =================================== */
@media (max-width: 992px) {
    .admin-dashboard {
        display: block;
    }
    
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .admin-sidebar.active {
        left: 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    
    .admin-main {
        width: 100%;
        margin-left: 0 !important;
    }
    
    /* Mobile menu toggle button */
    .mobile-menu-toggle {
        display: block !important;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
        background: linear-gradient(135deg, #1B3C53 0%, #234C6A 100%);
        border: none;
        border-radius: 50%;
        color: white;
        font-size: 24px;
        box-shadow: 0 4px 15px rgba(27, 60, 83, 0.4);
        z-index: 999;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle:hover {
        transform: scale(1.1);
    }
    
    .mobile-menu-toggle.active {
        background: var(--color-danger);
    }
    
    /* Overlay when sidebar is open */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .admin-header {
        padding: 15px 20px;
        flex-wrap: wrap;
    }
    
    .admin-header h1 {
        font-size: 24px;
        width: 100%;
        margin-bottom: 15px;
    }
    
    .admin-header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .admin-content {
        padding: 20px;
    }
    
    /* Stats grid mobile */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    /* Dashboard grid mobile */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Form rows mobile */
    .form-row {
        grid-template-columns: 1fr !important;
    }
    
    /* Table responsive */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table table {
        min-width: 600px;
    }
    
    /* Notifications panel mobile */
    .notifications-panel {
        right: 0;
        left: 0;
        width: 100% !important;
        max-width: 100%;
        border-radius: 0;
        top: 60px;
    }
    
    /* Modal mobile */
    .modal-content {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .admin-header h1 {
        font-size: 20px;
    }
    
    .stat-card {
        padding: 20px 15px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 13px;
    }
}

/* ===================================
   Student Dashboard Mobile
   =================================== */
@media (max-width: 992px) {
    .student-dashboard {
        display: block;
    }
    
    .student-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .student-sidebar.active {
        left: 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    
    .student-main {
        width: 100%;
        margin-left: 0 !important;
    }
}

@media (max-width: 768px) {
    .student-header {
        padding: 15px 20px;
    }
    
    .student-content {
        padding: 20px;
    }
    
    .welcome-banner {
        padding: 25px 20px;
    }
    
    .welcome-banner h2 {
        font-size: 24px;
    }
    
    .welcome-banner p {
        font-size: 16px;
    }
    
    .overview-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .appointment-card {
        flex-direction: column;
        text-align: center;
    }
    
    .appointment-date {
        width: 100%;
    }
    
    /* Weekly Calendar Mobile */
    .weekly-calendar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .calendar-header,
    .calendar-body {
        min-width: 800px;
    }
    
    .calendar-cell {
        min-height: 60px;
        padding: 5px;
    }
    
    .time-slot-label {
        padding: 20px 5px;
        font-size: 12px;
    }
    
    .slot-badge {
        font-size: 10px;
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .welcome-banner {
        padding: 20px 15px;
    }
    
    .welcome-banner h2 {
        font-size: 20px;
    }
    
    .welcome-banner p {
        font-size: 14px;
    }
    
    .overview-card {
        padding: 20px 15px;
    }
    
    .task-item,
    .appointment-card {
        padding: 20px 15px;
    }
}

/* ===================================
   Public Pages Mobile (Index, PDFs, Pricing, etc.)
   =================================== */
@media (max-width: 768px) {
    /* Hero section */
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-content {
        padding: 0 20px;
    }
    
    .hero-title {
        font-size: 32px;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 24px;
    }
    
    .hero-description {
        font-size: 16px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    /* Services grid */
    .services-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    /* Pricing grid */
    .pricing-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 0 20px;
    }
    
    .pricing-card {
        max-width: 100%;
    }
    
    /* Clubs grid */
    .clubs-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* PDFs grid */
    .pdfs-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    /* About section */
    .about-content {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }
    
    .about-image {
        height: 300px;
    }
    
    /* VM grid */
    .vm-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* FAQ grid */
    .faq-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* CTA section */
    .cta {
        padding: 60px 20px;
    }
    
    .cta-title {
        font-size: 28px;
    }
    
    .cta-subtitle {
        font-size: 18px;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 40px;
        text-align: center;
    }
    
    .footer-section {
        align-items: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 20px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .btn-large {
        padding: 14px 28px;
        font-size: 16px;
    }
    
    .pricing-card {
        padding: 30px 20px;
    }
    
    .price-amount {
        font-size: 36px;
    }
}

/* ===================================
   Application Form Mobile
   =================================== */
@media (max-width: 768px) {
    .application-layout {
        grid-template-columns: 1fr !important;
    }
    
    .application-form {
        padding: 30px 20px;
    }
    
    .application-form h2 {
        font-size: 24px;
    }
    
    .form-section h3 {
        font-size: 18px;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
        padding: 12px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* ===================================
   Clubs Page Mobile
   =================================== */
@media (max-width: 768px) {
    .club-hero {
        padding: 80px 20px 40px;
        grid-template-columns: 1fr !important;
        text-align: center;
    }
    
    .club-hero-content h1 {
        font-size: 28px;
    }
    
    .club-hero-image {
        height: 250px;
        order: -1;
    }
    
    .clubs-grid {
        padding: 0 20px;
    }
    
    .club-card {
        padding: 25px 20px;
    }
}

/* ===================================
   Navbar Mobile Improvements
   =================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
    }
    
    .nav-logo img {
        width: 40px;
        height: 40px;
    }
    
    .nav-brand span {
        font-size: 18px;
    }
    
    .nav-toggle {
        width: 40px;
        height: 40px;
    }
    
    .nav-toggle span {
        height: 2px;
    }
    
    .nav-menu {
        padding: 20px;
        top: 70px;
    }
    
    .nav-link {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .nav-link:hover {
        background: var(--color-light);
        border-radius: 8px;
    }
}

/* ===================================
   Touch-friendly improvements
   =================================== */
@media (max-width: 768px) {
    /* Larger touch targets */
    .btn,
    button,
    a.btn,
    .nav-link,
    .admin-nav-link,
    .student-nav-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Better spacing for touch */
    .form-group {
        margin-bottom: 20px;
    }
    
    /* Prevent text selection on buttons */
    .btn,
    button {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        user-select: none;
    }
    
    /* Smooth scrolling */
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* ===================================
   Landscape orientation fixes
   =================================== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 80px 0 40px;
    }
    
    .admin-login-container,
    .student-login-container {
        padding: 20px;
    }
    
    .admin-login-box,
    .student-login-box {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ===================================
   Print styles
   =================================== */
@media print {
    .navbar,
    .admin-sidebar,
    .student-sidebar,
    .mobile-menu-toggle,
    .sidebar-overlay,
    .admin-header-actions,
    .footer,
    .cta {
        display: none !important;
    }
    
    .admin-main,
    .student-main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .admin-content,
    .student-content {
        padding: 0 !important;
    }
}

/* ===================================
   Accessibility improvements
   =================================== */
@media (max-width: 768px) {
    /* Focus indicators */
    button:focus,
    a:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid #1B3C53;
        outline-offset: 2px;
    }
    
    /* Skip to main content link */
    .skip-to-main {
        position: absolute;
        top: -40px;
        left: 0;
        background: #1B3C53;
        color: white;
        padding: 10px 20px;
        text-decoration: none;
        z-index: 10000;
    }
    
    .skip-to-main:focus {
        top: 0;
    }
}
