/* Global Responsive Styles - FantasyXXX Members Portal */
/* This file handles responsive behavior for all pages */

/* ============================================ */
/* 1280x1024 SPECIFIC FIXES */
/* ============================================ */

@media (max-width: 1320px) and (min-width: 1025px) {
    /* Messages page specific */
    #messagesLayout {
        grid-template-columns: 300px 1fr !important;
        gap: 12px !important;
    }
    
    #conversationsList {
        max-width: 300px;
    }
    
    /* Dashboard grid adjustments */
    .dashboard-grid,
    .models-grid,
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    }
    
    /* Profile stats - wrap earlier */
    .profile-stats {
        flex-wrap: wrap;
        gap: 12px !important;
    }
    
    /* Forms - stack on narrow screens */
    .form-row {
        flex-direction: column !important;
    }
    
    /* Tables - enable horizontal scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
}

/* ============================================ */
/* MESSAGES PAGE RESPONSIVE */
/* ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    #messagesLayout {
        grid-template-columns: 250px 1fr !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    #messagesLayout {
        grid-template-columns: 1fr !important;
        height: auto !important;
        min-height: 400px !important;
    }
    
    #conversationsList {
        max-height: 300px;
    }
    
    #messagesArea {
        min-height: 400px;
    }
    
    /* Emoji picker mobile adjustments */
    #emojiPicker {
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100vw - 48px) !important;
        max-width: 280px !important;
    }
}

/* ============================================ */
/* GRID LAYOUTS - RESPONSIVE */
/* ============================================ */

/* Models/Images/Videos grids */
.models-grid,
.images-grid,
.videos-grid {
    display: grid;
    gap: 16px;
}

/* Desktop large */
@media (min-width: 1400px) {
    .models-grid,
    .images-grid,
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Desktop standard & 1280x1024 */
@media (min-width: 1025px) and (max-width: 1399px) {
    .models-grid,
    .images-grid,
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .models-grid,
    .images-grid,
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    .models-grid,
    .images-grid,
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .models-grid,
    .images-grid,
    .videos-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================ */
/* PROFILE PAGE RESPONSIVE */
/* ============================================ */

@media (max-width: 1320px) and (min-width: 1025px) {
    .profile-header {
        flex-wrap: wrap;
    }
    
    .profile-stats {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-stats {
        justify-content: center;
    }
}

/* ============================================ */
/* FORMS RESPONSIVE */
/* ============================================ */

.form-row {
    display: flex;
    gap: 16px;
}

@media (max-width: 1320px) and (min-width: 1025px) {
    .form-row {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
}

/* ============================================ */
/* TABLES RESPONSIVE */
/* ============================================ */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
}

@media (max-width: 1320px) {
    .table-responsive {
        display: block;
    }
    
    table {
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    table {
        min-width: 600px;
        font-size: 13px;
    }
    
    th, td {
        padding: 8px !important;
    }
}

/* ============================================ */
/* HORIZONTAL SCROLL INDICATOR */
/* ============================================ */

@media (max-width: 1320px) {
    /* Add subtle shadow to indicate scrollable content */
    .table-responsive::after,
    .scrollable-content::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to left, rgba(0,0,0,0.1), transparent);
        pointer-events: none;
    }
}

/* ============================================ */
/* UTILITY CLASSES */
/* ============================================ */

/* Force horizontal scroll when needed */
.scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Prevent horizontal scroll */
.no-scroll-x {
    overflow-x: hidden;
}

/* Responsive text sizes */
@media (max-width: 1320px) and (min-width: 1025px) {
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
}

/* ============================================ */
/* SMOOTH SCROLLBAR STYLING */
/* ============================================ */

/* Better scrollbar for horizontal scrolling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,47,179,0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,47,179,0.7);
}

/* ============================================ */
/* PRINT STYLES */
/* ============================================ */

@media print {
    .sidebar,
    .rightbar,
    .header,
    .footer,
    .mobile-menu-toggle,
    .mobile-search-toggle,
    .mobile-sidebar-toggle {
        display: none !important;
    }
    
    .layout {
        grid-template-columns: 1fr !important;
    }
    
    .main {
        width: 100% !important;
    }
}
