/* Custom CSS for Kabaddi Live Score */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.table th {
    border-top: none;
    font-weight: 600;
}

.btn-group-sm > .btn, .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.display-6 {
    font-size: 2.5rem;
}

/* Responsive touch targets */
@media (hover: none) {
    .btn, .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    .display-6 {
        font-size: 1.5rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    /* Stack team logos vertically on mobile */
    .col-md-4.text-center {
        margin-bottom: 1rem;
    }
    
    /* Make images responsive */
    .img-fluid {
        max-width: 60px !important;
    }
    
    /* Make buttons full width on mobile */
    .btn-group-vertical.w-100 .btn {
        width: 100%;
    }
    
    /* Reduce padding in tables for mobile */
    .table {
        font-size: 0.85rem;
    }
    
    .table th, .table td {
        padding: 0.4rem;
    }
    
    /* Stack timeline items on mobile */
    .timeline-item {
        font-size: 0.85rem;
    }
    
    /* Make badges smaller on mobile */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }
}

/* Medium devices (tablets, less than 768px) */
@media (max-width: 767.98px) {
    .display-6 {
        font-size: 2rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    /* Stack columns on mobile */
    .col-md-3, .col-md-4, .col-md-6, .col-md-12 {
        margin-bottom: 1rem;
    }
    
    /* Make player stat cards stack vertically */
    .player-stat-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stat-button {
        width: 100%;
        margin: 0.25rem 0;
    }
    
    /* Make modal full width on mobile */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    /* Adjust navbar for mobile */
    .navbar-collapse {
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }
    
    /* Center align text in cards on mobile */
    .card-header {
        text-align: center;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Make forms responsive */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Large devices (desktops, less than 992px) */
@media (max-width: 991.98px) {
    /* Adjust timer controls for smaller screens */
    .timer-display {
        font-size: 1.8rem;
    }
    
    .team-score {
        font-size: 2rem;
    }
}

/* Extra large devices (large desktops) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
}

/* Responsive tables - horizontal scroll on small screens */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Make buttons accessible on touch devices */
.btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Responsive image handling */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive card grid adjustments */
@media (max-width: 576px) {
    .card {
        border-radius: 8px;
    }
    
    /* Stack top performer cards */
    .col-md-6 {
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* Responsive navigation */
@media (max-width: 768px) {
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .dropdown-menu {
        text-align: center;
    }
}

/* Live match specific responsive adjustments */
#live-match-container {
    padding-bottom: 2rem;
}

@media (max-width: 768px) {
    #match-timer {
        font-size: 1.5rem;
    }
    
    /* Adjust team score display */
    .team-score {
        font-size: 1.8rem;
    }
    
    /* Make player stats more compact */
    .table-sm {
        font-size: 0.8rem;
    }
}

/* Toast notification positioning for mobile */
.toast-container {
    position: fixed;
    z-index: 1050;
}

@media (max-width: 576px) {
    .toast-container {
        left: 0;
        right: 0;
        padding: 0.5rem;
    }
    
    .toast {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Responsive player stat cards */
@media (max-width: 768px) {
    .player-stat-row {
        flex-wrap: wrap;
        padding: 0.75rem;
    }
    
    .player-stat-row > * {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Responsive quick score controls */
@media (max-width: 768px) {
    .btn-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-grid-single {
        grid-template-columns: 1fr;
    }
}

/* Substitution players section responsive */
.substitute-players {
    margin-top: 1rem;
}

@media (max-width: 576px) {
    .substitute-players {
        padding: 0.5rem;
    }
}

/* Match header responsive adjustments */
@media (max-width: 576px) {
    .score-header {
        padding: 0.5rem;
        height: auto;
    }
    
    .score-header .row {
        text-align: center;
    }
}

/* Timeline responsive adjustments */
.timeline-item {
    padding-left: 1rem;
    margin-left: 0.5rem;
}

@media (max-width: 576px) {
    .timeline-item {
        padding-left: 0.75rem;
        margin-left: 0.25rem;
    }
    
    .timeline-item .d-flex {
        flex-direction: column;
    }
    
    .timeline-item .flex-grow-1 {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* Prevent horizontal overflow on mobile */
body {
    overflow-x: hidden;
}

.container, .container-fluid {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

@media (max-width: 576px) {
    .container, .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
}