/**
 * Responsive CSS - Media Portal V3
 *
 * Breakpoint System (Desktop-First):
 * - Base: >= 1440px (desktop - no media query needed)
 * - Medium Desktop: 1280px - 1439px
 * - Tablet/Small Laptop: 800px - 1279px
 * - Mobile: < 800px
 */

/* ===========================
   MEDIUM DESKTOP (1280px - 1439px)
   =========================== */
@media all and (max-width: 1439px) {
    /* === TYPOGRAPHY - Reduce 14px to 12px === */
    .layout-left-bottom p,
    .layout-top a,
    p,
    .search-bar input,
    .nav-link,
    th, td,
    .option-wrapper .option,
    .date-picker-input input,
    .select-box b,
    .select-box p,
    .popup-wrapper input,
    .popup-wrapper textarea,
    .publish-date b,
    .publish-date span,
    .coverage-summery-details p,
    .view-coverage-header-left p {
        font-size: 12px !important;
    }

    /* === LAYOUT === */
    .all-coverages {
        max-width: 1100px;
    }

    .coverage-title h4 {
        font-size: 16px;
    }

    .coverage-title span {
        color: #989898;
        background: #F6F7FA;
        font-size: 12px;
    }

    .tooltip-icon {
        top: 10px;
    }

    .single-report h3 {
        font-size: 26px;
        color: #231F20;
        padding-top: 5px;
    }

    .single-report > img {
        transform: scale(0.8);
        left: 12px;
    }

    .single-report {
        padding-left: 68px;
    }

    .button-action {
        padding: 12px 12px !important;
        font-size: 13px;
        min-width: 155px;
    }

    /* === SIDEBAR - Reduce by 20% === */
    .sidebar-area {
        min-width: 80px;
        padding: 26px 13px;
    }

    .sidebar-area ul li a {
        width: 42px;
        height: 42px;
    }

    .sidebar-top > a img {
        max-width: 48px;
    }

    .sidebar-top > a {
        margin-bottom: 40px;
    }

    .sidebar-area ul li {
        margin-bottom: 19px;
    }

    /* Adjust content area padding for smaller sidebar */
    .dashboard-main-content-area {
        padding-left: 104px;
    }

    .result-page-wrap {
        padding-left: 80px;
    }
}

/* Base: Show full labels, hide short labels */
.label-short {
    display: none;
}

/* ===========================
   MEDIA LABELS - Short labels under 1130px
   =========================== */
@media all and (max-width: 1129px) {
    .label-full {
        display: none;
    }
    .label-short {
        display: inline;
    }
}

/* ===========================
   TABLET / SMALL LAPTOP (800px - 1279px)
   =========================== */
@media all and (max-width: 1279px) {

    /* === TYPOGRAPHY === */
    .layout-left-bottom p,
    .layout-top a,
    p,
    .search-bar input,
    .nav-link,
    th, td,
    .option-wrapper .option,
    .date-picker-input input,
    .select-box b,
    .select-box p,
    .popup-wrapper input,
    .popup-wrapper textarea,
    .publish-date b,
    .publish-date span,
    .coverage-summery-details p,
    .view-coverage-header-left p {
        font-size: 11px !important;
    }

    /* === LAYOUT === */
    .all-coverages {
        max-width: 880px;
    }

    .single-coverage {
        grid-template-columns: 1.5fr 1fr;
        grid-gap: 30px;
        padding: 32px 10px 32px 32px;
    }

    .coverage-title h4 {
        font-size: 14px;
    }

    .coverage-title span {
        font-size: 11px;
    }

    .tooltip-icon {
        top: 8px;
    }

    .single-report h3 {
        font-size: 22px;
    }

    .single-report > img {
        transform: scale(0.65);
        left: 10px;
    }

    .single-report {
        padding-left: 55px;
    }

    .dashboard-media-reports {
        grid-gap: 12px;
    }

    .button-action {
        padding: 10px 10px !important;
        font-size: 12px;
        min-width: unset;
    }

    /* === SIDEBAR === */
    .sidebar-area {
        min-width: 65px;
        padding: 20px 10px;
    }

    .sidebar-area ul li a {
        width: 34px;
        height: 34px;
    }

    .sidebar-top > a img {
        max-width: 38px;
    }

    .sidebar-top > a {
        margin-bottom: 32px;
    }

    .sidebar-area ul li {
        margin-bottom: 15px;
    }

    /* === CONTENT AREA === */
    .dashboard-main-content-area {
        padding-left: 85px;
    }

    .result-page-wrap {
        padding-left: 65px;
    }

    /* === REPORT CARDS - Consistent widths === */
    .dashboard-media-reports {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }

    .single-report {
        min-width: 0;
        flex: 1 1 0;
    }

    /* === TABLE - Last column (actions) === */
    .dt-coverageTable th:last-child,
    .dt-coverageTable td:last-child,
    .dt-coverageTable .actions-col {
        max-width: 150px !important;
        width: 150px !important;
        min-width: 150px !important;
    }

    .dt-coverageTable .actions-col > div {
        gap: 8px !important;
    }

    /* === TYPE TAG - Reduce font size === */
    .type-tag {
        font-size: 10px !important;
    }

    /* === NAV TABS - Reduce width === */
    .nav-link {
        padding: 8px 12px !important;
        font-size: 11px !important;
    }

    /* === OVERFLOW FIX - Prevent horizontal scroll === */
    .result-page-wrap .custom-search-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }

    .result-page-header-right .custom-search-wrapper.increase-weight {
        width: 100% !important;
    }

    .custom-select.date-select .options-container {
        width: auto !important;
        max-width: calc(100vw - 100px) !important;
    }

    /* === DATE PICKER === */
    .date-picker-months {
        width: 250px !important;
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
    }

    .date-picker-periods {
        width: 250px !important;
        flex-shrink: 0;
    }
}

/* ===========================
   MOBILE (< 1000px)
   =========================== */
@media all and (max-width: 999px) {
    /* === CONVERT SIDEBAR TO TOP BAR === */
    .sidebar-area {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        height: 60px !important;
        width: 100% !important;
        min-width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 12px !important;
        background: #fff !important;
        border-bottom: 1px solid #E9EAEB !important;
        border-right: none !important;
        z-index: 100 !important;
    }

    /* Horizontal layout for sidebar sections */
    .sidebar-top {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        height: auto !important;
        flex: 0 0 auto !important;
    }

    .sidebar-bottom {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 4px !important;
        height: auto !important;
        flex: 0 0 auto !important;
    }

    .sidebar-top ul,
    .sidebar-bottom ul {
        display: flex !important;
        flex-direction: row !important;
        gap: 4px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .sidebar-top ul li,
    .sidebar-bottom ul li {
        display: flex !important;
        margin: 0 !important;
    }

    /* Logo smaller on mobile */
    .sidebar-top > a {
        margin-bottom: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    .sidebar-top > a img {
        max-width: 32px !important;
        height: 32px !important;
    }

    /* Smaller icons for mobile top bar */
    .sidebar-area ul li a {
        width: 40px !important;
        height: 40px !important;
        padding: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .sidebar-area ul li a img {
        width: 24px !important;
        height: 24px !important;
    }

    /* === HIDE BURGER BUTTON - Logo acts as burger on mobile === */
    .sidebar-burger {
        display: none !important;
    }

    /* === LOGO AS BURGER TRIGGER === */
    .sidebar-logo {
        cursor: pointer;
        border-radius: 8px;
        padding: 4px;
        transition: background 0.2s;
    }

    .sidebar-logo:hover,
    .sidebar-logo.active {
        background: #FEF7EE;
    }

    /* === CONTENT AREA - Full width with top padding === */
    .dashboard-main-content-area,
    .result-page-wrap {
        margin-left: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 60px !important;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* === REMOVE ALL SIDE SPACING ON MOBILE === */
    .dashboard-area {
        background-color: #fff !important;
    }

    .dashboard.content {
        padding: 0 !important;
        margin: 0 !important;
    }

    .home-content-wrapper {
        border-radius: 0 !important;
        margin: 0 !important;
    }

    /* === MOBILE DRAWER - Starts below top bar === */
    .mobile-drawer {
        top: 60px !important;
        left: 0 !important;
        height: calc(100% - 60px) !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .mobile-drawer-overlay {
        display: block !important;
    }

    /* === HIDE PAGE CONTROLS FROM MAIN CONTENT === */
    .result-page-header .nav-toggle {
        display: none !important;
    }

    /* === FILTERS BAR - Keep visible === */
    .result-page-header-filter {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 12px !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .result-page-header-filter > div:first-child {
        width: 100% !important;
    }

    /* Hide nav toggle and actions from filter header - only in burger */
    .result-page-header-filter > div:last-child {
        display: none !important;
    }

    /* Also hide action buttons directly */
    .result-page-header-filter .button-action {
        display: none !important;
    }

    .result-page-header-filter .nav-toggle {
        display: none !important;
    }

    /* === HIDE MEDIA BAR AND ACTIONS - Only in burger menu === */
    .result-page-controller-btns {
        display: none !important;
    }

    /* === REPORT CARDS === */
    .single-report {
        min-width: 250px !important;
        width: 100%;
    }

    /* === MINIMUM SCREEN WIDTH === */
    html {
        min-width: 375px;
    }

    body {
        min-width: 375px;
        overflow-x: auto;
    }

    /* === SUMMARY CARDS - Stack responsively === */
    .dashboard-media-reports {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 8px;
    }

    .single-report {
        min-width: 250px !important;
        width: 100%;
    }

    /* Hide tooltip icons on mobile */
    .tooltip-icon {
        display: none !important;
    }

    /* === COVERAGE GRID - Responsive === */
    .all-coverages {
        max-width: 100% !important;
    }

    .single-coverage {
        grid-template-columns: 1fr !important;
        padding: 16px !important;
    }

    /* === HIDE FILTER BUTTONS FROM MAIN PAGE ON MOBILE - They're in burger menu === */
    .table-view-header-wrapper .tag-filter-dropdown-custom,
    .table-view-header-wrapper .contributor-filter-dropdown-custom,
    .table-view-header-wrapper .type-filter-dropdown-custom,
    .result-page-header-filter .tag-filter-dropdown-custom,
    .result-page-header-filter .contributor-filter-dropdown-custom,
    .result-page-header-filter .type-filter-dropdown-custom {
        display: none !important;
    }

    /* === RESULT PAGE CONTENT === */
    .result-page-main-content {
        max-width: 100%;
        overflow-x: hidden;
    }

    .page-table-content-wrapper {
        max-width: 100%;
        overflow-x: auto;
    }
}

/* === SIDEBAR BURGER BUTTON (hidden by default) === */
.sidebar-burger {
    display: none;
    width: 42px;
    height: 42px;
    background: #FEF7EE;
    border: none;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    margin-bottom: 16px;
    transition: background 0.2s;
}

.sidebar-burger:hover {
    background: #FDEDD7;
}

.sidebar-burger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #DD5B19;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.sidebar-burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.sidebar-burger.active span:nth-child(2) {
    opacity: 0;
}

.sidebar-burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* === MOBILE DRAWER OVERLAY (hidden by default) === */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
}

.mobile-drawer-overlay.active {
    visibility: visible;
    opacity: 1;
}

.mobile-drawer {
    position: absolute;
    top: 0;
    left: 65px; /* Positioned next to sidebar */
    width: 320px;
    max-width: calc(100vw - 85px);
    height: 100%;
    background: #FFFFFF;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-drawer-overlay.active .mobile-drawer {
    transform: translateX(0);
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #E9EAEB;
    flex-shrink: 0;
}

.mobile-drawer-header span {
    font-size: 18px;
    font-weight: 600;
    color: #231F20;
}

.mobile-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #717680;
    transition: background 0.2s, color 0.2s;
}

.mobile-drawer-close:hover {
    background: #F8F9FA;
    color: #414651;
}

.mobile-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.mobile-drawer-empty {
    color: #717680;
    font-size: 14px;
    text-align: center;
    padding: 40px 20px;
}

/* Mobile drawer section styles */
.mobile-drawer-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #E9EAEB;
    max-width: 250px;
}

.mobile-drawer-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.mobile-drawer-section-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #717680;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Adjust drawer position based on sidebar width at different breakpoints */
@media all and (max-width: 1279px) {
    .mobile-drawer {
        left: 65px;
    }
}

@media all and (max-width: 1439px) and (min-width: 1280px) {
    .mobile-drawer {
        left: 80px;
    }
}

/* Mobile drawer button styles - unified look (all same as Quick months/Time period) */
.mobile-drawer-content .mobile-date-toggle,
.mobile-drawer-content .mobile-media-btn,
.mobile-drawer-content .nav-toggle .nav-toggle-group .nav-toggle-button,
.mobile-drawer-content .nav-toggle .nav-toggle-group a.nav-toggle-button,
.mobile-drawer-content .nav-toggle .nav-toggle-group span.nav-toggle-button,
.mobile-drawer-content .nav-toggle-button,
.mobile-drawer-content a.nav-toggle-button,
.mobile-drawer-content span.nav-toggle-button,
.mobile-drawer-content .button-action {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    border: 1px solid #E9EAEB !important;
    border-radius: 8px !important;
    background: #fff !important;
    background-color: #fff !important;
    color: #414651 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer;
    width: 100% !important;
    text-align: left !important;
    text-decoration: none !important;
    min-width: unset !important;
    height: 40px !important;
}

/* Nav toggle group wrapper - reset background */
.mobile-drawer-content .nav-toggle .nav-toggle-group {
    background: transparent !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 0 !important;
}

.mobile-drawer-content .mobile-date-toggle:hover,
.mobile-drawer-content .mobile-media-btn:hover,
.mobile-drawer-content .nav-toggle-button:hover,
.mobile-drawer-content .button-action:hover {
    border-color: #DD5B19 !important;
    background: #FEF7EE !important;
    background-color: #FEF7EE !important;
    color: #DD5B19 !important;
}

/* Remove selected/active state - all buttons look the same */
.mobile-drawer-content .mobile-media-btn.selected,
.mobile-drawer-content .nav-toggle-button.active,
.mobile-drawer-content span.nav-toggle-button.active,
.mobile-drawer-content a.nav-toggle-button.active {
    border: 1px solid #E9EAEB !important;
    background: #fff !important;
    background-color: #fff !important;
    color: #414651 !important;
}

.mobile-drawer-content .mobile-media-btn.selected img,
.mobile-drawer-content .nav-toggle-button.active img {
    filter: none !important;
}

.mobile-date-toggle .chevron {
    transition: transform 0.2s;
}

.mobile-date-toggle.open .chevron {
    transform: rotate(180deg);
}

/* Make all icons grey by default in mobile drawer */
.mobile-drawer-content .mobile-date-toggle img,
.mobile-drawer-content .button-action img {
    filter: grayscale(100%) opacity(0.6);
}

/* Filter active state - show colored icon when filter is selected */
.mobile-date-toggle.filter-active {
    border-color: #DD5B19 !important;
    background: #FEF7EE !important;
}

.mobile-date-toggle.filter-active img {
    filter: none;
}

.mobile-date-toggle.filter-active span {
    color: #DD5B19 !important;
}

.mobile-date-list {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: #F9FAFB;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.mobile-date-list.open {
    display: flex;
}

.mobile-date-option {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    color: #414651;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.mobile-date-option:hover {
    background: #FEF7EE;
    color: #DD5B19;
}

.mobile-date-option.selected {
    background: #DD5B19;
    color: #fff;
}

/* Mobile drawer content styles */
@media all and (max-width: 999px) {
    /* Navigation toggle in drawer - stack vertically */
    .mobile-drawer-content .nav-toggle .nav-toggle-group {
        flex-direction: column;
        width: 100%;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        gap: 8px;
    }

    .mobile-drawer-content .nav-toggle .nav-toggle-button {
        width: 100%;
        justify-content: flex-start;
        min-width: unset !important;
    }

    /* Filter buttons in drawer - full width */
    .mobile-drawer-content .date-selector-button,
    .mobile-drawer-content .filter-button,
    .mobile-drawer-content .custom-select {
        width: 100%;
    }

    .mobile-drawer-content .date-selector-button .select-box,
    .mobile-drawer-content .filter-button {
        width: 100%;
    }

    /* Action buttons in drawer */
    .mobile-drawer-content .button-action {
        width: 100%;
        justify-content: center;
    }

    /* Date picker dropdown positioning in drawer */
    .mobile-drawer-content .date-picker-dropdown {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100vw - 40px);
        z-index: 1100;
    }

    /* Filter dropdowns in drawer */
    .mobile-drawer-content .filter-dropdown,
    .mobile-drawer-content .type-filter-dropdown,
    .mobile-drawer-content .contributor-filter-dropdown {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100vw - 40px);
        z-index: 1100;
    }
}
