/* Mobile First Responsive Design */

/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {
    .container {
        padding: 0 15px;
    }
    
    .navbar .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .auth-form {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .matches-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .profile-card {
        margin-bottom: 1rem;
    }
    
    .chat-container {
        flex-direction: column;
        height: auto;
    }
    
    .chat-sidebar {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .chat-main {
        height: calc(100vh - 280px);
    }
    
    .message {
        max-width: 90%;
    }
    
    .call-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .call-btn {
        width: 60px;
        height: 60px;
    }
    
    .local-video {
        width: 120px;
        height: 90px;
        bottom: 80px;
        right: 10px;
    }
}

/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) {
    .matches-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chat-sidebar {
        width: 300px;
    }
}

/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) {
    .matches-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .container {
        max-width: 1200px;
    }
}

/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {
    .matches-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .auth-form {
        max-width: 400px;
    }
}

/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {
    .matches-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Mobile menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 1000;
    padding: 2rem;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
}

.mobile-nav-links li {
    margin-bottom: 1rem;
}

.mobile-nav-links a {
    text-decoration: none;
    color: #333;
    font-size: 1.1rem;
    display: block;
    padding: 0.5rem 0;
}

/* Touch-friendly buttons */
.btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Improved form elements for mobile */
.form-group input,
.form-group select,
.form-group textarea {
    font-size: 16px; /* Prevents zoom on iOS */
}

/* Safe area insets for notch phones */
@supports(padding: max(0px)) {
    .container {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo {
        font-weight: 600;
    }
}

/* Print styles */
@media print {
    .navbar,
    .chat-input,
    .call-controls {
        display: none !important;
    }
    
    .chat-messages {
        height: auto;
        overflow: visible;
    }
}