/* ============================================
   MOBILE RESPONSIVE STYLES
   Mobile-first responsive design for all systems
   ============================================ */

/* ============================================
   BASE MOBILE STYLES
   ============================================ */

/* Ensure proper scaling on mobile */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Touch-friendly minimum sizes */
button,
a,
.clickable {
    min-height: 44px;
    min-width: 44px;
}

/* ============================================
   TABLET (768px - 1024px)
   ============================================ */

@media (max-width: 1024px) {

    /* General adjustments */
    .container {
        padding: 0 16px;
    }

    /* Reduce font sizes slightly */
    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 20px;
    }
}

/* ============================================
   MOBILE (< 768px)
   ============================================ */

@media (max-width: 768px) {

    /* ==================== STUDIO DASHBOARD ==================== */

    /* Main grid to single column */
    .studio-grid,
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    /* Series/Webtoon cards */
    .series-card,
    .webtoon-card {
        width: 100%;
    }

    /* Tab navigation */
    .studio-tabs,
    .dashboard-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .studio-tabs::-webkit-scrollbar,
    .dashboard-tabs::-webkit-scrollbar {
        display: none;
    }

    /* Assignment Manager */
    .assignment-manager {
        flex-direction: column !important;
    }

    .assignment-manager>div {
        width: 100% !important;
        max-width: none !important;
    }

    .translator-list,
    .content-list {
        max-height: 300px !important;
    }

    /* Stats cards stack */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    /* ==================== SUPPORT MANAGEMENT ==================== */

    /* Support tabs wrap */
    .support-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .support-tab {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
    }

    /* DMCA Form */
    .dmca-form .form-group {
        width: 100%;
    }

    /* Mail template editor */
    .template-editor {
        width: 95% !important;
    }

    /* Comment cards */
    .comment-card {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Ticket list */
    .ticket-list {
        grid-template-columns: 1fr !important;
    }

    /* ==================== ADMIN PANEL ==================== */

    /* Module grid single column */
    .admin-modules,
    .module-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* Admin sidebar */
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        background: #16191f;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    /* Hamburger menu button */
    .admin-hamburger {
        display: block !important;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 1001;
        background: #8b5cf6;
        border: none;
        border-radius: 8px;
        padding: 12px;
        cursor: pointer;
    }

    /* Tables horizontal scroll */
    .admin-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        min-width: 600px;
    }

    /* ==================== TIMELINE EDITOR ==================== */

    /* Vertical layout */
    .video-studio-page {
        flex-direction: column !important;
    }

    /* Asset panel horizontal */
    .asset-panel {
        width: 100% !important;
        height: 200px !important;
        border-right: none !important;
        border-bottom: 1px solid #1e293b;
    }

    /* Preview panel */
    .preview-panel {
        height: 250px !important;
    }

    /* Timeline tracks */
    .timeline-section {
        min-height: 200px !important;
    }

    .timeline-tracks {
        min-height: 150px !important;
    }

    /* Timeline controls wrap */
    .timeline-controls {
        flex-wrap: wrap;
        gap: 8px;
    }

    .timeline-controls button {
        flex: 1 1 calc(33.333% - 6px);
        min-width: 80px;
    }

    /* Zoom controls */
    .zoom-controls {
        width: 100%;
        justify-content: center;
    }

    /* ==================== MODALS ==================== */

    /* All modals full width on mobile */
    .modal-content,
    .quick-edit-modal,
    .approval-modal,
    .webtoon-upload-modal {
        width: 95% !important;
        max-width: none !important;
        margin: 20px auto;
    }

    /* Modal body scrollable */
    .modal-body {
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }

    /* Form groups full width */
    .form-group {
        width: 100%;
    }

    /* Modal footer stack */
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }

    .modal-footer button {
        width: 100%;
    }

    /* ==================== GENERAL UI ==================== */

    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }

    /* Show mobile-only elements */
    .mobile-only {
        display: block !important;
    }

    /* Reduce padding */
    .page-container {
        padding: 12px;
    }

    /* Stack flex containers */
    .flex-row-mobile-stack {
        flex-direction: column !important;
    }

    /* Full width buttons */
    .btn-mobile-full {
        width: 100% !important;
    }

    /* Smaller font sizes */
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    h4 {
        font-size: 16px;
    }

    /* Touch-friendly spacing */
    .card {
        padding: 16px;
    }

    /* Grid to list */
    .grid-mobile-list {
        display: flex !important;
        flex-direction: column;
    }
}

/* ============================================
   SMALL MOBILE (< 480px)
   ============================================ */

@media (max-width: 480px) {

    /* Even smaller text */
    body {
        font-size: 13px;
    }

    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }

    h3 {
        font-size: 16px;
    }

    /* Tighter spacing */
    .page-container {
        padding: 8px;
    }

    .card {
        padding: 12px;
    }

    /* Single column everything */
    .stats-grid,
    .feature-grid,
    .content-grid {
        grid-template-columns: 1fr !important;
    }

    /* Smaller modals */
    .modal-content {
        width: 100% !important;
        margin: 0;
        border-radius: 0;
        height: 100vh;
    }

    /* Stack all buttons */
    .button-group {
        flex-direction: column;
        width: 100%;
    }

    .button-group button {
        width: 100%;
    }
}

/* ============================================
   LANDSCAPE MODE (Mobile)
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {

    /* Reduce header height */
    .page-header {
        height: 48px;
    }

    /* Compact timeline */
    .timeline-section {
        min-height: 120px !important;
    }

    /* Smaller preview */
    .preview-panel {
        height: 180px !important;
    }

    /* Hide asset panel in landscape */
    .asset-panel {
        display: none;
    }
}

/* ============================================
   TOUCH INTERACTIONS
   ============================================ */

/* Remove hover effects on touch devices */
@media (hover: none) {

    .card:hover,
    .btn:hover {
        transform: none;
    }
}

/* Active states for touch */
@media (hover: none) {
    .card:active {
        transform: scale(0.98);
    }

    .btn:active {
        transform: scale(0.95);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .show-mobile {
        display: block !important;
    }
}

/* Responsive text alignment */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center !important;
    }
}

/* Responsive margins */
@media (max-width: 768px) {
    .m-mobile-0 {
        margin: 0 !important;
    }

    .mt-mobile-0 {
        margin-top: 0 !important;
    }

    .mb-mobile-0 {
        margin-bottom: 0 !important;
    }

    .mx-mobile-0 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Responsive padding */
@media (max-width: 768px) {
    .p-mobile-0 {
        padding: 0 !important;
    }

    .pt-mobile-0 {
        padding-top: 0 !important;
    }

    .pb-mobile-0 {
        padding-bottom: 0 !important;
    }

    .px-mobile-0 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* ============================================
   ACTOR DETAIL RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .actor-hero-modern {
        flex-direction: column;
        padding: 20px !important;
        gap: 20px !important;
        text-align: center;
    }

    .actor-avatar-lg {
        width: 140px !important;
        height: 140px !important;
        margin: 0 auto;
        border-radius: 50% !important;
        /* Circle on mobile looks better usually, or keep rounded rect */
    }

    .actor-details-lg {
        width: 100%;
    }

    .actor-details-lg h1 {
        font-size: 2rem !important;
        justify-content: center;
        display: flex;
    }

    .actor-details-lg p {
        justify-content: center;
        display: flex;
    }

    .actor-stats-lg {
        justify-content: center;
        gap: 20px !important;
    }

    .actor-details-lg div[style*="justify-content: space-between"] {
        flex-direction: column;
        align-items: center !important;
        gap: 15px;
    }
}