/* ============================================
   AUDOUNE APP - Custom Responsive & Modern CSS
   ============================================ */

/* ============================================
   GLOBAL MODERN STYLES
   ============================================ */

/* --- Root variables --- */
:root {
    --sidebar-bg: #1a1d2e;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(99, 102, 241, 0.2);
    --sidebar-text: #b0b3c5;
    --sidebar-text-active: #ffffff;
    --sidebar-category: rgba(255, 255, 255, 0.35);
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 10px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --primary-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --success-soft: #e8ffe0;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* --- Smooth transitions globally --- */
*, *::before, *::after {
    transition-property: background-color, border-color, box-shadow, opacity, transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

/* --- Modern sidebar --- */
.app-sidebar {
    background: var(--sidebar-bg) !important;
    border-right: none !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}
.app-sidebar .main-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.app-sidebar .main-menu .slide {
    margin: 1px 8px;
}
.app-sidebar .side-menu__item {
    border-radius: 8px !important;
    padding: 10px 14px !important;
    color: var(--sidebar-text) !important;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 10px;
}
.app-sidebar .side-menu__item:hover {
    background: var(--sidebar-hover) !important;
    color: var(--sidebar-text-active) !important;
    transform: translateX(2px);
}
.app-sidebar .side-menu__item.active,
.app-sidebar .side-menu__item[aria-current="page"] {
    background: var(--sidebar-active) !important;
    color: var(--sidebar-text-active) !important;
    font-weight: 600;
}
.app-sidebar .side-menu__item i,
.app-sidebar .side-menu__item .side-menu__icon {
    width: 20px;
    height: 20px;
    font-size: 15px;
    opacity: 0.7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.app-sidebar .side-menu__item:hover i,
.app-sidebar .side-menu__item:hover .side-menu__icon {
    opacity: 1;
}
.app-sidebar .slide__category .category-name {
    color: var(--sidebar-category) !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    padding: 18px 14px 6px !important;
}

/* --- Modern header --- */
.app-header {
    background: #ffffff !important;
    border-bottom: 1px solid #f0f0f5 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}
.app-header .header-link {
    border-radius: 8px;
    padding: 6px 10px;
    transition: background var(--transition-fast);
}
.app-header .header-link:hover {
    background: #f4f4f8;
}

/* --- Modern cards --- */
.card.custom-card {
    border: 1px solid #eef0f5 !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--card-shadow) !important;
    overflow: hidden;
    transition: box-shadow var(--transition-normal);
}
.card.custom-card:hover {
    box-shadow: var(--card-shadow-hover) !important;
}
.card-header {
    background: #fafbfd !important;
    border-bottom: 1px solid #eef0f5 !important;
    font-weight: 600;
}
.card-title h5,
.card-title {
    font-weight: 700 !important;
    color: #1e1e2d;
    font-size: 1rem;
}

/* --- Modern table styles --- */
.v-data-table {
    border-radius: var(--border-radius) !important;
    overflow: hidden;
}
.v-data-table table thead th {
    background: #f8f9fc !important;
    color: #5e5873 !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-bottom: 2px solid #eef0f5 !important;
    padding: 12px 16px !important;
    white-space: nowrap;
}
.v-data-table table tbody td {
    padding: 10px 16px !important;
    font-size: 13.5px;
    color: #3b3f5c;
    border-bottom: 1px solid #f4f5f8 !important;
    vertical-align: middle;
}
.v-data-table table tbody tr:hover td {
    background: #f8f9fc !important;
}

/* --- Softer row colors (green/white alternation) --- */
.style-1-row {
    background-color: #edfce5 !important;
}
.style-1-row:hover {
    background-color: #ddf8d0 !important;
}
.style-2-row {
    background-color: #ffffff !important;
}
.style-2-row:hover {
    background-color: #f8f9fc !important;
}

/* --- Modern buttons --- */
.btn {
    border-radius: 8px !important;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all var(--transition-fast);
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.btn:active {
    transform: translateY(0);
}
.btn-primary {
    background: var(--primary-gradient) !important;
    border: none !important;
}
.btn-primary:hover {
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4) !important;
}

/* --- Modern badges --- */
.badge {
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 6px;
    padding: 4px 10px;
}
.badge.rounded-pill {
    border-radius: 50px;
}

/* --- Modern form controls --- */
.form-control,
.form-select {
    border-radius: 8px !important;
    border: 1.5px solid #e0e3eb !important;
    padding: 8px 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    font-size: 13.5px;
}
.form-control:focus,
.form-select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12) !important;
}

/* --- Modern admin actions bar --- */
.admin-actions-bar {
    background: var(--primary-gradient) !important;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    padding: 10px 16px !important;
    border: none !important;
}
.admin-actions-bar .btn-light {
    background: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    font-weight: 600;
    font-size: 12px;
    border-radius: 6px !important;
    padding: 6px 12px;
}
.admin-actions-bar .btn-light:hover {
    background: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

/* --- Vuetify search field modern --- */
.v-text-field .v-input__control .v-input__slot::before {
    border-color: #e0e3eb !important;
}
.v-text-field .v-input__control .v-input__slot::after {
    border-color: #6366f1 !important;
}

/* --- Sales cards modern --- */
.sales-card {
    border-radius: var(--border-radius) !important;
    border: 1px solid #eef0f5 !important;
    box-shadow: var(--card-shadow) !important;
    transition: all var(--transition-normal);
}
.sales-card:hover {
    box-shadow: var(--card-shadow-hover) !important;
    transform: translateY(-2px);
}

/* --- Breadcrumb modern --- */
.breadcrumb-header {
    padding: 16px 0 8px;
}
.main-content-title {
    font-weight: 700;
    color: #1e1e2d;
    font-size: 1.3rem;
}
.breadcrumb-item a {
    color: #6366f1;
    font-weight: 500;
}

/* --- Circle icon modern --- */
.circle-icon {
    border-radius: 12px !important;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Alerts modern --- */
.alert {
    border-radius: 10px !important;
    border: none !important;
    font-size: 13.5px;
}

/* --- Loading overlay --- */
.vld-overlay .vld-background {
    backdrop-filter: blur(2px);
}

/* --- Scrollbar modern --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #c5c8d4;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a0a3b1;
}

/* --- Logo display quality --- */
.app-sidebar .main-sidebar-header {
    padding: 12px 16px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-sidebar .main-sidebar-header .header-logo {
    display: flex;
    align-items: center;
}
.app-sidebar .main-sidebar-header .header-logo img {
    height: 4rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
.horizontal-logo .header-logo img {
    height: 2rem;
    width: auto;
}

/* --- Responsive Overlay (mobile sidebar backdrop) --- */
#responsive-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none;
    transition: opacity 0.3s ease;
}
#responsive-overlay.active {
    display: block;
}

/* ============================================
   MOBILE (max-width: 991.98px)
   ============================================ */
@media (max-width: 991.98px) {

    /* --- Sidebar mobile --- */
    .app-sidebar {
        position: fixed !important;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 100;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    html[data-toggled="open"] .app-sidebar {
        left: 0;
    }
    html[data-toggled="close"] .app-sidebar {
        left: -280px;
    }

    /* --- Main content full width --- */
    .main-content {
        margin-left: 0 !important;
        margin-inline-start: 0 !important;
        padding: 10px !important;
    }

    /* --- Header adjustments --- */
    .app-header {
        margin-left: 0 !important;
        margin-inline-start: 0 !important;
    }
    .app-header .main-header-container {
        padding: 0 10px;
    }
    .main-header-center {
        display: none !important;
    }

    /* --- Admin actions bar mobile --- */
    .admin-actions-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding: 8px !important;
    }
    .admin-actions-bar .d-flex {
        flex-wrap: nowrap !important;
        overflow-x: auto;
    }
    .admin-actions-bar .btn {
        font-size: 0.7rem;
        padding: 4px 8px;
        white-space: nowrap;
    }
    .admin-actions-bar .me-3 {
        display: none;
    }

    /* --- Tables responsive --- */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        min-width: auto;
    }
    .card table,
    .card-body table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .card table thead,
    .card table tbody,
    .card table tr,
    .card table td,
    .card table th {
        white-space: nowrap;
    }

    /* --- Cards mobile --- */
    .card {
        margin-bottom: 10px;
    }
    .card-body {
        padding: 12px !important;
    }
    .card-header {
        padding: 10px 12px !important;
    }

    /* --- Forms mobile --- */
    .row > [class*="col-lg-"],
    .row > [class*="col-md-"] {
        margin-bottom: 8px;
    }
    .form-control,
    .form-select {
        font-size: 14px;
    }
    .btn {
        font-size: 13px;
    }

    /* --- Modals mobile --- */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    .modal-body {
        padding: 15px;
    }

    /* --- Stats boxes / dashboard --- */
    .row .col-xl-3,
    .row .col-xl-4,
    .row .col-xl-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* --- Pagination mobile --- */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }
    .pagination .page-link {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* --- Search / filter bars --- */
    .d-flex.align-items-center.gap-2,
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }

    /* --- Typography mobile --- */
    h1, .h1 { font-size: 1.4rem; }
    h2, .h2 { font-size: 1.2rem; }
    h3, .h3 { font-size: 1.1rem; }
    h4, .h4 { font-size: 1rem; }
    h5, .h5 { font-size: 0.9rem; }

    /* --- User profile in header --- */
    .header-element .d-xl-block {
        display: none !important;
    }

    /* --- Badge / notification adjustments --- */
    .badge {
        font-size: 0.6rem;
    }

    /* --- Hide non-essential elements on mobile --- */
    .d-none-mobile {
        display: none !important;
    }

    /* --- Breadcrumb --- */
    .breadcrumb {
        font-size: 0.8rem;
    }

    /* --- Page header --- */
    .page-header-breadcrumb {
        flex-direction: column;
        gap: 5px;
    }
}

/* ============================================
   SMALL MOBILE (max-width: 575.98px)
   ============================================ */
@media (max-width: 575.98px) {

    /* --- Full width columns --- */
    .row .col-xl-3,
    .row .col-xl-4,
    .row .col-xl-6,
    .row .col-md-6,
    .row .col-md-4,
    .row .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* --- Even smaller text --- */
    .card-body {
        padding: 10px !important;
    }

    /* --- Table cell sizes on very small screens --- */
    .card table td,
    .card table th {
        padding: 6px 8px !important;
        font-size: 12px;
    }

    /* --- Buttons stacked --- */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    .btn-group .btn {
        border-radius: 4px !important;
        margin-bottom: 4px;
    }

    /* --- Modal full width --- */
    .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
    }

    /* --- Action buttons in tables --- */
    td .btn,
    td .btn-sm {
        padding: 3px 6px;
        font-size: 11px;
        margin: 1px;
    }

    /* --- Header compact --- */
    .app-header .header-link-icon {
        width: 18px;
        height: 18px;
    }
    .app-header .header-element {
        padding: 0 4px;
    }
}

/* ============================================
   TABLET (768px - 991.98px)
   ============================================ */
@media (min-width: 768px) and (max-width: 991.98px) {
    .row .col-xl-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .row .col-xl-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ============================================
   VUETIFY v-data-table responsive
   ============================================ */
@media (max-width: 991.98px) {
    .v-data-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .v-data-table table {
        min-width: 600px;
    }
    .v-data-table .v-data-table__wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .v-card-title {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px;
    }
    .v-card-title input[type="text"],
    .v-card-title .form-control {
        width: 100% !important;
        max-width: 100% !important;
    }
    .table-pro {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* --- Vuetify mobile mode: fix stacked rows --- */
    .v-data-table--mobile .v-data-table__mobile-row {
        text-align: left !important;
        justify-content: flex-start !important;
        padding: 4px 12px !important;
        min-height: 36px;
        flex-direction: row !important;
    }
    .v-data-table--mobile .v-data-table__mobile-row__header {
        font-weight: 600;
        color: #555;
        min-width: 120px;
        text-align: left !important;
    }
    .v-data-table--mobile .v-data-table__mobile-row__cell {
        text-align: left !important;
        flex: 1;
    }
    .v-data-table--mobile .v-data-table__mobile-table-row {
        border-bottom: 2px solid #e0e0e0;
        margin-bottom: 8px;
        padding: 8px 0;
        border-radius: 8px;
        overflow: hidden;
    }
    /* Reduce intensity of row background colors on mobile */
    .v-data-table--mobile .style-1-row {
        background-color: #e8ffe0 !important;
        border-left: 4px solid #9bff2d;
    }
    .v-data-table--mobile .style-2-row {
        background-color: #fff !important;
        border-left: 4px solid #ddd;
    }

    /* --- Search input full width on mobile --- */
    .card-header {
        flex-direction: column !important;
        gap: 8px;
    }
    .card-header .card-title {
        margin-bottom: 5px;
    }

    /* --- Breadcrumb header --- */
    .breadcrumb-header {
        flex-direction: column;
        gap: 5px;
    }
    .breadcrumb-header .left-content {
        margin-bottom: 5px;
    }
    .main-content-title {
        font-size: 1.1rem;
    }

    /* --- Vuetify footer / pagination --- */
    .v-data-footer {
        flex-wrap: wrap;
        justify-content: center;
        padding: 8px 4px;
    }
    .v-data-footer__select {
        margin: 4px 8px;
    }
    .v-data-footer__pagination {
        margin: 4px 0;
    }
}

@media (max-width: 575.98px) {
    .v-data-table table {
        font-size: 12px;
    }
    .v-data-table table td,
    .v-data-table table th {
        padding: 6px 8px !important;
    }
    .v-data-table .badge {
        font-size: 0.65rem;
        padding: 3px 6px;
    }

    /* --- Vuetify mobile: even more compact --- */
    .v-data-table--mobile .v-data-table__mobile-row {
        padding: 2px 8px !important;
        font-size: 13px;
    }
    .v-data-table--mobile .v-data-table__mobile-row__header {
        min-width: 90px;
        font-size: 12px;
    }

    /* --- Softer row colors on small mobile --- */
    .style-1-row {
        background-color: #e8ffe0 !important;
    }
    .style-1-row:hover {
        background-color: #d9ffc7 !important;
    }
}

/* ============================================
   PRINT - hide sidebar/header
   ============================================ */
@media print {
    .app-sidebar,
    .app-header,
    .admin-actions-bar,
    #responsive-overlay {
        display: none !important;
    }
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}
