/* ============================================================
   FFP RADIO – MOBILE OPTIMIZATION (Single File)
   Include this in your header.php or main layout
   ============================================================ */

/* --- 1. VIEWPORT & BASE --- */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- 2. ALL DASHBOARD CONTAINERS --- */
.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    max-width: 100%;
    background: #1a1a1a;
}

.sidebar-artist {
    width: 100%;
    flex-shrink: 0;
}

.main-area {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding-bottom: 70px; /* space for bottom nav */
}

/* --- 3. CARDS & GRIDS --- */
.card {
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Stack all form rows */
.form-row,
.contributor-row,
.two-col,
.settings-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
}

/* --- 4. BOTTOM NAVIGATION (replaces sidebar on mobile) --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2d2d2d;
    display: flex;
    justify-content: space-around;
    padding: 6px 0 env(safe-area-inset-bottom);
    border-top: 1px solid #3a3a3a;
    z-index: 999;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #8a8a8a;
    font-size: 10px;
    text-decoration: none;
    padding: 4px 8px;
    min-height: 44px;
    justify-content: center;
}

.bottom-nav a i {
    font-size: 20px;
    margin-bottom: 2px;
}

.bottom-nav a.active {
    color: #c8a45c;
}

/* --- 5. SIDEBAR TOGGLE (hamburger for sidebar) --- */
.sidebar-toggle {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    background: #c8a45c;
    color: #0a0a0a;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 22px;
    box-shadow: 0 4px 20px rgba(200, 164, 92, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-artist {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: 0.3s;
    z-index: 999;
    background: #2d2d2d;
    overflow-y: auto;
}

.sidebar-artist.open {
    transform: translateX(0);
}

/* Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 998;
}

.sidebar-overlay.active {
    display: block;
}

/* --- 6. BUTTONS & INPUTS (touch-friendly) --- */
.btn,
button,
a.button,
input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 20px;
    font-size: 16px !important;
}

input,
select,
textarea {
    font-size: 16px !important;
    padding: 12px 14px;
    min-height: 44px;
}

.upload-zone {
    padding: 25px 15px;
}

.dsp-card {
    padding: 14px 10px;
    min-height: 80px;
}

/* --- 7. IMAGES --- */
img,
.release-summary img,
.release-cover {
    max-width: 100%;
    height: auto;
}

.release-summary {
    flex-direction: column;
    text-align: center;
}

.release-summary img {
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

/* --- 8. TABLES (scrollable) --- */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -10px;
    padding: 0 10px;
}

.table-dark th,
.table-dark td {
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 10px;
}

/* --- 9. STEP INDICATOR --- */
.step-indicator {
    flex-wrap: wrap;
    gap: 4px;
    background: transparent;
}

.step {
    flex: 1 1 45%;
    padding: 10px 8px;
    font-size: 12px;
    border-radius: 6px;
    margin: 2px 0;
}

.step::after {
    display: none;
}

/* --- 10. TRACK ITEMS --- */
.track-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.track-actions {
    width: 100%;
    justify-content: flex-start;
}

/* --- 11. DSP GRID --- */
.dsp-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
}

/* --- 12. NAV BUTTONS --- */
.nav-buttons {
    flex-direction: column;
    gap: 10px;
}

.nav-buttons .btn {
    width: 100%;
    justify-content: center;
}

/* --- 13. AUDIO PLAYER --- */
.audio-preview audio {
    max-width: 100%;
    height: 36px;
}

.audio-file-info {
    flex-direction: column;
    align-items: flex-start;
}

/* --- 14. TYPOGRAPHY --- */
h1 {
    font-size: 1.5rem;
}
h2 {
    font-size: 1.3rem;
}
h3 {
    font-size: 1.15rem;
}
h4 {
    font-size: 1rem;
}
p,
li,
.form-label {
    font-size: 0.95rem;
}
.card-title {
    font-size: 1.1rem;
}

/* --- 15. HIDE SIDEBAR ON MOBILE (show via toggle) --- */
.sidebar-artist {
    display: none;
}

.sidebar-artist.open {
    display: block;
}

/* --- 16. FIX FOR NAVBAR (if you have one) --- */
.navbar {
    flex-wrap: wrap;
}

.nav-menu {
    flex-direction: column;
    width: 100%;
    gap: 5px;
}

.nav-menu a {
    padding: 12px 0;
    font-size: 16px;
}

/* ============================================================
   DESKTOP OVERRIDES (768px and up)
   ============================================================ */
@media (min-width: 769px) {
    .dashboard-container {
        flex-direction: row;
        padding: 30px;
        gap: 25px;
    }

    .sidebar-artist {
        display: block !important;
        position: relative;
        width: 280px;
        transform: none !important;
        background: transparent;
    }

    .sidebar-toggle,
    .bottom-nav,
    .sidebar-overlay {
        display: none !important;
    }

    .main-area {
        padding-bottom: 0;
    }

    .form-row,
    .contributor-row,
    .two-col {
        grid-template-columns: 1fr 1fr !important;
    }

    .dsp-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    }

    .track-item {
        flex-direction: row;
    }

    .track-actions {
        width: auto;
    }

    .nav-buttons {
        flex-direction: row;
    }

    .nav-buttons .btn {
        width: auto;
    }

    .step-indicator {
        flex-wrap: nowrap;
    }

    .step {
        flex: 1;
        font-size: 14px;
    }

    .step::after {
        display: block;
    }

    .audio-file-info {
        flex-direction: row;
        align-items: center;
    }

    .release-summary {
        flex-direction: row;
        text-align: left;
    }

    .table-wrapper {
        margin: 0;
        padding: 0;
    }

    .table-dark th,
    .table-dark td {
        white-space: normal;
        font-size: 14px;
        padding: 12px 15px;
    }
}

/* ============================================================
   SMALL PHONES (max 480px)
   ============================================================ */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .step {
        flex: 1 1 100%;
        font-size: 11px;
        padding: 8px;
    }

    .dsp-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .card {
        padding: 14px;
    }

    .bottom-nav a {
        font-size: 9px;
    }

    .bottom-nav a i {
        font-size: 18px;
    }

    .btn,
    button,
    input[type="submit"] {
        font-size: 14px !important;
        padding: 10px 16px;
    }

    .sidebar-artist {
        width: 85%;
    }
}