/* Responsive styles for Futismestari */

/* MOBILE: Styles for screens up to 768px (iPhone and small tablets) */
@media (max-width: 768px) {
    /* Fix viewport issues on iPhone */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    body {
        background-size: cover;
        background-attachment: scroll; /* Fix for iOS background-attachment: fixed issue */
        background-position: center center;
    }
    
    .dashboard-header { 
        font-size: 1.2em; 
        padding: 1em 0 0.7em 0;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    
    .container { 
        max-width: 100%; 
        margin: 0.5rem;
        padding: 1rem;
        background: rgba(245, 248, 250, 0.95);
        border-radius: 15px;
    }
    
    .sidebar.open { 
        width: 100vw; 
        z-index: 9999;
    }
    
    h1, h2, h3, h4 { 
        font-size: 1.3em;
        line-height: 1.3;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    button, input[type="submit"], .btn { 
        font-size: 1em; 
        padding: 0.6em 1.2em;
        min-height: 44px; /* Apple's recommended minimum touch target */
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Fix table overflow on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
        border-radius: 10px;
    }
    
    .matches-table {
        min-width: 600px; /* Ensure table doesn't get too compressed */
        font-size: 0.9rem;
    }
    
    .matches-table th,
    .matches-table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Dashboard cards mobile optimization */
    .dashboard-card {
        margin-bottom: 1rem;
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .dashboard-container {
        padding: 1rem;
    }
    
    /* Filter form mobile layout */
    .filter-form {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .form-group select {
        padding: 0.8rem;
        font-size: 1rem;
        min-height: 44px;
    }
    
    /* Navigation buttons mobile */
    .nav-controls {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .nav-center {
        grid-column: 1;
    }
    
    .nav-btn {
        padding: 1rem 1.5rem;
        min-height: 44px;
        justify-content: center;
    }
    
    /* Prediction panel mobile */
    .prediction-panel {
        margin: 0.5rem;
        max-width: none;
    }
    
    .panel-content {
        padding: 1.5rem;
    }
    
    .match-teams {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .team {
        font-size: 1.1rem;
        text-align: center;
        padding: 0.8rem;
    }
    
    .prediction-score {
        font-size: 2rem;
    }
    
    /* Stats grid mobile */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    /* Input improvements for mobile */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.8rem;
        border-radius: 8px;
        min-height: 44px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Notification improvements */
    .notification-item {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .notification-btn {
        width: 100%;
        padding: 0.8rem;
        min-height: 44px;
    }
    
    /* Menu button improvements */
    .menu-btn {
        font-size: 1.6em;
        padding: 0.5rem;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Sidebar improvements */
    .sidebar a {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        line-height: 1.4;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Language selector improvements */
    .sidebar form {
        padding: 1rem 2rem;
    }
    
    .sidebar select {
        margin-bottom: 0.5rem;
        min-height: 44px;
    }
}

/* SMALL MOBILE: Extra small screens (iPhone SE, small Android) */
@media (max-width: 480px) {
    .dashboard-header {
        font-size: 1.1em;
        padding: 0.8em 0 0.6em 0;
    }
    
    .container {
        margin: 0.25rem;
        padding: 0.75rem;
        border-radius: 10px;
    }
    
    h1, h2, h3, h4 {
        font-size: 1.1em;
    }
    
    .matches-table {
        font-size: 0.8rem;
    }
    
    .matches-table th,
    .matches-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .dashboard-card {
        padding: 1rem;
    }
    
    .filter-form {
        padding: 1rem;
    }
}

/* DESKTOP: Styles for screens 990px and wider */
@media (min-width: 990px) {
    .dashboard-header { font-size: 2em; padding: 1.5em 0 1.2em 0; }
    .container { max-width: 900px; margin: 2em auto; padding: 2em; }
    .sidebar.open { width: 320px; }
    h1, h2, h3, h4 { font-size: 1.5em; }
    button, input[type="submit"], .btn { font-size: 1.1em; padding: 0.5em 1.5em; }
}

/* Custom alert-info style */
.alert-info {
    background: linear-gradient(90deg, #0f9d58 0%, #43cea2 100%) !important; 
    color: #ffffff !important;            
    border-color: #0f9d58 !important;     
    font-weight: bolder;
    font-size: 1.2em;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.group-name-alert {
    max-width: 300px;
    width: 100%;
    margin: 0 auto;
}