/*
 * Cuori Online - Responsive Styles
 * Responsive design per mobile e tablet
 */

/* ============================================
   BREAKPOINTS
   ============================================ */

/* Large Desktop */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Desktop */
@media (max-width: 1200px) {
    .search-container {
        grid-template-columns: 280px 1fr;
        gap: 20px;
    }
    
    .users-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Tablet */
@media (max-width: 992px) {
    .nav-menu {
        padding: 15px;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-container {
        grid-template-columns: 1fr;
    }
    
    .search-filters {
        position: static;
    }
    
    .messages-container {
        grid-template-columns: 300px 1fr;
    }
    
    .welcome-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .welcome-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Large Mobile */
@media (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-dark-secondary);
        flex-direction: column;
        padding: 20px;
        gap: 10px;
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-normal);
        z-index: 999;
    }
    
    .nav-menu.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 15px;
    }
    
    .profile-btn {
        width: 100%;
        justify-content: flex-start;
    }
    
    .profile-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding-left: 20px;
    }
    
    /* Hero */
    .hero {
        padding: 40px 15px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    /* Auth */
    .auth-card {
        padding: 25px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Dashboard */
    .dashboard-container {
        padding: 20px 15px;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .users-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .user-card-image {
        height: 150px;
    }
    
    /* Search */
    .search-filters {
        padding: 20px 15px;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    /* Messages */
    .messages-container {
        grid-template-columns: 1fr;
    }
    
    .conversations-list {
        display: none;
    }
    
    .conversations-list.show {
        display: flex;
    }
    
    .chat-area {
        display: none;
    }
    
    .chat-area.show {
        display: flex;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    /* Profile */
    .profile-info {
        padding: 70px 15px 20px;
    }
    
    .profile-info h1 {
        font-size: 22px;
    }
    
    .profile-details {
        flex-direction: column;
        gap: 10px;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .profile-actions .btn {
        width: 100%;
    }
    
    /* Likes */
    .likes-tabs {
        flex-direction: column;
    }
    
    .likes-tabs .tab {
        justify-content: flex-start;
    }
    
    /* Edit Profile */
    .edit-profile-card {
        padding: 20px 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Settings */
    .settings-card {
        padding: 20px 15px;
    }
    
    /* Admin */
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        display: none;
    }
    
    .admin-content {
        padding: 20px 15px;
    }
    
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-info .stat-value {
        font-size: 20px;
    }
    
    /* Tables */
    .admin-table {
        font-size: 13px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 10px 8px;
    }
    
    /* Footer */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    /* Base */
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    /* Navigation */
    .nav-logo span {
        display: none;
    }
    
    .nav-logo {
        font-size: 18px;
    }
    
    /* Hero */
    .hero-title {
        font-size: 26px;
    }
    
    .stat-box {
        padding: 10px 15px;
    }
    
    .stat-box .stat-value {
        font-size: 20px;
    }
    
    /* Dashboard */
    .welcome-banner {
        padding: 20px 15px;
    }
    
    .welcome-content h1 {
        font-size: 22px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .users-grid {
        grid-template-columns: 1fr;
    }
    
    /* Messages */
    .conversation-item {
        padding: 12px;
    }
    
    .conv-avatar {
        width: 40px;
        height: 40px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .message-content {
        padding: 10px 12px;
    }
    
    /* Profile */
    .profile-avatar-large {
        width: 120px;
        height: 120px;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .btn-lg {
        padding: 14px 24px;
    }
    
    /* Cards */
    .feature-card,
    .testimonial-card,
    .user-card {
        padding: 20px 15px;
    }
    
    /* Admin */
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .admin-table-container {
        overflow-x: auto;
    }
    
    .admin-table {
        min-width: 600px;
    }
    
    /* Modal */
    .modal-content {
        padding: 20px 15px;
        margin: 15px;
    }
}

/* Extra Small */
@media (max-width: 360px) {
    .hero-title {
        font-size: 22px;
    }
    
    .users-grid {
        gap: 10px;
    }
    
    .user-card-image {
        height: 120px;
    }
}

/* ============================================
   UTILITÀ RESPONSIVE
   ============================================ */

/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Show on mobile */
@media (max-width: 768px) {
    .show-mobile {
        display: block !important;
    }
    
    .show-mobile-flex {
        display: flex !important;
    }
}

/* ============================================
   TOUCH OPTIMIZATIONS
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn,
    .nav-link,
    .user-card-actions button,
    .user-card-actions a {
        min-height: 44px;
    }
    
    /* Prevent delay on tap */
    a, button, input, select, textarea {
        touch-action: manipulation;
    }
    
    /* Disable hover effects on touch */
    .btn:hover,
    .nav-link:hover,
    .user-card:hover {
        transform: none;
    }
    
    /* Show tap highlight */
    :active {
        -webkit-tap-highlight-color: var(--primary);
    }
}

/* ============================================
   ORIENTATION
   ============================================ */

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 30px 15px;
    }
    
    .hero-visual {
        display: none;
    }
    
    .auth-container {
        min-height: auto;
        padding: 20px 15px;
    }
}

/* ============================================
   REDUCE MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
