/* ==========================================================================
   CHANNEL Z MOBILE RESPONSIVE STYLES
   Override CM1's fixed-width layout for mobile devices
   ========================================================================== */
/* Default calendar icon size for all screens */
.date-display img {
    width: 20px !important;
    height: 20px !important;
}



/* ==========================================================================
   TABLET & SMALLER DESKTOPS (1200px and below)
   ========================================================================== */
@media (max-width: 1200px) {
    /* Force all CM1 regions to be fluid */
    .perc-region {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
    }
    
    /* Main container */
    #container {
        width: 100% !important;
        height: auto !important;
        padding: 10px !important;
    }
    
    /* Sidebar - full width on tablet */
    #leftsidebar {
        width: 100% !important;
        height: auto !important;
        margin-bottom: 20px;
    }
    
    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
    }
    
    /* Middle content area */
    #middle {
        width: 100% !important;
        height: auto !important;
    }
    
    /* Header region */
    #header {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    
    .header-region {
        margin-bottom: 10px;
    }
    
    /* Welcome header */
    .welcome-header {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }
    
    /* Content cards */
    .content-card {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 1.5rem !important;
        width: 100% !important;
    }
    
    /* Remove fixed positioning conflicts */
    .perc-fixed {
        position: relative !important;
    }
}

/* ==========================================================================
   TABLET PORTRAIT & MOBILE LANDSCAPE (768px and below)
   ========================================================================== */
@media (max-width: 768px) {
    /* Body adjustments */
    body {
        padding: 16px !important;
    }
    
    /* Welcome Banner */
    .welcome-header {
        height: 200px !important;
        border-radius: 10px !important;
        margin-bottom: 10px !important;
    }
    
    .welcome-inner {
        padding: 60px 12px 0px 12px !important;
    }
    
    .date-display {
        font-size: 0.9rem !important;
        gap: 6px !important;
        margin-bottom: 6px !important;
    }
    
    .date-display img {
        width: 16px !important;
        height: 16px !important;
    }
    
    /* Calendar Navigation Controls */
    .calendar-controls {
        flex-direction: column !important;
        gap: 8px !important;
        padding: 8px !important;
    }
    
    .nav-btn {
        width: 100% !important;
        padding: 8px 12px !important;
        font-size: 14px !important;
    }
    
    .date-picker {
        width: 100% !important;
        justify-content: center !important;
    }
    
    #datePicker {
        width: 150px !important;
    }
    
    /* Sidebar Navigation */
    .sidebar-header h1 {
        font-size: 1.5rem !important;
        letter-spacing: 2px !important;
        padding: 0.75rem 1rem !important;
    }
    
    .nav-toggle,
    .nav-link {
        font-size: 0.85rem !important;
        padding: 0.75rem 1rem !important;
    }
    
    .nav-toggle:hover,
    .nav-link:hover {
        padding-left: 1.25rem !important;
    }
    
    .sub-menu li a {
        font-size: 0.8rem !important;
        padding: 0.6rem 1rem 0.6rem 2rem !important;
    }
    
    .sub-menu li a:hover {
        padding-left: 2.25rem !important;
    }
    
    .nav-item.nested .sub-menu li a {
        padding-left: 2.5rem !important;
    }
    
    .nav-item.nested .sub-menu li a:hover {
        padding-left: 2.75rem !important;
    }
    
    /* Action Buttons */
    .action-btn {
        width: 95% !important;
        font-size: 0.9rem !important;
        padding: 0.8rem 0.9rem !important;
    }
    
    .action-btn-icon {
        width: 22px !important;
        height: 22px !important;
    }
    
    /* Content Cards */
    .content-card {
        padding: 1.25rem !important;
        border-radius: 12px !important;
    }
    
    .content-card h1 {
        font-size: 32px !important;
    }
    
    .content-card h2 {
        font-size: 26px !important;
    }
    
    .content-card h3 {
        font-size: 20px !important;
    }
    
    /* Tables */
    .forms-table {
        font-size: 14px !important;
    }
    
    .forms-table th,
    .forms-table td {
        padding: 12px 8px !important;
        font-size: 13px !important;
    }
    
    /* Quick Links */
    .quick-links {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .quick-link {
        font-size: 16px !important;
        padding: 14px !important;
    }
    
    /* Section Titles */
    .section-title {
        font-size: 16px !important;
        padding: 12px !important;
    }
    
    /* Calendar iframe */
    .ChannelZ-Calendar-iFrame {
        width: 100% !important;
    }
    
    #ChannelZCalendar {
        width: 100% !important;
        height: 1400px !important;
    }
}

/* ==========================================================================
   MOBILE PORTRAIT (480px and below)
   ========================================================================== */
@media (max-width: 480px) {
    /* Body */
    body {
        padding: 10px !important;
        font-size: 14px !important;
    }
    
    /* Welcome Banner - more compact */
    .welcome-header {
        height: 180px !important;
        border-radius: 8px !important;
        margin-bottom: 8px !important;
    }
    
    .welcome-inner {
        padding: 50px 8px 0px 8px !important;
    }
    
    .date-display {
        font-size: 0.8rem !important;
        gap: 4px !important;
        flex-wrap: wrap !important;
    }
    
    /* Calendar Controls - even more compact */
    .calendar-controls {
        padding: 6px !important;
        gap: 6px !important;
    }
    
    .nav-btn {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
    
    #datePicker {
        width: 120px !important;
        font-size: 11px !important;
    }
    
    /* Sidebar */
    .sidebar-header h1 {
        font-size: 1.25rem !important;
        letter-spacing: 1px !important;
    }
    
    .sidebar-header img {
        width: 90% !important;
    }
    
    .nav-toggle,
    .nav-link {
        font-size: 0.8rem !important;
        padding: 0.65rem 0.85rem !important;
    }
    
    .nav-icon {
        width: 16px !important;
        height: 16px !important;
    }
    
    .sub-menu li a {
        font-size: 0.75rem !important;
        padding: 0.5rem 0.85rem 0.5rem 1.75rem !important;
    }
    
    /* Action Buttons */
    .action-btn {
        width: 98% !important;
        font-size: 0.85rem !important;
        padding: 0.7rem 0.8rem !important;
        gap: 0.4rem !important;
    }
    
    .action-btn-icon {
        width: 20px !important;
        height: 20px !important;
    }
    
    .action-btn .btn-text .title {
        font-size: 0.85rem !important;
    }
    
    .action-btn .btn-text .sub {
        font-size: 0.7rem !important;
    }
    
    /* Content Cards */
    .content-card {
        padding: 1rem !important;
        border-radius: 10px !important;
        min-height: 300px !important;
    }
    
    .content-card h1 {
        font-size: 28px !important;
    }
    
    .content-card h2 {
        font-size: 22px !important;
    }
    
    .content-card h3 {
        font-size: 18px !important;
    }
    
    .content-card p {
        font-size: 14px !important;
    }
    
    /* Tables - make scrollable on very small screens */
    .forms-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .forms-table {
        min-width: 320px !important;
    }
    
    .forms-table th,
    .forms-table td {
        padding: 10px 6px !important;
        font-size: 12px !important;
    }
    
    /* Section Titles */
    .section-title {
        font-size: 14px !important;
        padding: 10px !important;
    }
    
    /* Quick Links */
    .quick-link {
        font-size: 14px !important;
        padding: 12px !important;
    }
    
    /* Calendar iframe */
    #ChannelZCalendar {
        height: 1200px !important;
    }
}

/* ==========================================================================
   LANDSCAPE ORIENTATION ADJUSTMENTS
   ========================================================================== */
@media (max-width: 768px) and (orientation: landscape) {
    .welcome-header {
        height: 160px !important;
    }
    
    .welcome-inner {
        padding: 40px 12px 0px 12px !important;
    }
    
    .sidebar-header img {
        width: 80% !important;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    .sidebar,
    .calendar-controls,
    .action-buttons {
        display: none !important;
    }
    
    .content-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .welcome-header {
        height: auto !important;
        page-break-inside: avoid !important;
    }
}

/* ==========================================================================
   ACCESSIBILITY - REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}