/* Mobile-First Responsive Design */

/* Toggle sections */
.toggle-section { display: none; }
.active-section { display: block; }
.toggle-links {
    margin-bottom: 20px;
    font-size: 16px;
}
.toggle-links a {
    color: #fff;
    padding: 10px 15px;
    text-decoration: none;
    display: inline-block;
}
.toggle-links a:hover {
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
}

/* Base styles */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    position: relative;
    background: #121212;
    font-size: 16px;
    --bs-body-color: #ffffff;
    --bs-body-bg: #121212;
    --bs-secondary-color: rgba(255, 255, 255, 0.7);
    color: #ffffff;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/squash.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(0, 0, 0, 0.7);
    background-blend-mode: overlay;
    z-index: -1;
}

.container {
    position: relative;
    z-index: 1;
    color: #ffffff;
    padding: 15px;
}

/* Mobile-optimized tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

table {
    background: rgba(30, 30, 30, 0.9);
    color: #ffffff;
    border: 1px solid #666;
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
    --bs-table-bg: transparent;
    --bs-table-striped-bg: transparent;
    --bs-table-hover-bg: transparent;
    --bs-table-color: #ffffff;
    --bs-table-striped-color: #ffffff;
    --bs-table-hover-color: #ffffff;
    --bs-table-border-color: rgba(255,255,255,0.1);
}

th {
    background: rgba(100, 50, 50, 0.7) !important;
    font-weight: bold;
    color: #ffffff !important;
    text-align: left;
    padding: 12px 8px;
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    background: rgba(40, 40, 40, 0.8) !important;
    color: #ffffff !important;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

tr:nth-child(odd) td {
    background: rgba(70, 70, 70, 0.6) !important;
}

tr:hover td {
    background: rgba(70, 70, 70, 0.8) !important;
}

/* Forms and inputs */
.form-control, .form-select, .btn {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 10px 15px;
}

.form-control, .form-select {
    background-color: rgba(50, 50, 50, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

label, .form-label, .card-body, .card {
    color: #fff !important;
}

.search-container .form-control,
.search-container .form-select {
    margin-bottom: 10px;
    width: 100%;
}

.search-container {
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    white-space: nowrap;
    touch-action: manipulation;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

/* Info boxes */
.info-box {
    background: rgba(40, 40, 40, 0.9);
    border-left: 4px solid #007bff;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.stats-summary {
    background: rgba(40, 40, 40, 0.8);
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* Links */
a {
    color: #4dabf7;
}

a:hover {
    color: #74c0fc;
    text-decoration: none;
}

/* Navbar improvements */
.navbar {
    padding: 10px 15px;
}

.navbar-brand {
    font-size: 20px;
    font-weight: bold;
}

.navbar-nav .nav-link {
    padding: 10px 15px;
    font-size: 16px;
}

/* Modal improvements for mobile */
.modal-dialog {
    margin: 10px;
}

.modal-content {
    background: rgba(30, 30, 30, 0.98);
    color: #fff;
}

.modal-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* List groups */
.list-group-item {
    background: rgba(50, 50, 50, 0.8);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Tablet styles (768px and up) */
@media (min-width: 768px) {
    .container {
        padding: 20px;
    }

    table {
        font-size: 15px;
    }

    .search-container .form-control,
    .search-container .form-select {
        width: auto;
        margin-bottom: 0;
    }

    .modal-dialog {
        margin: 30px auto;
    }
}

/* Desktop styles (992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 1140px;
        padding: 30px;
    }

    table {
        font-size: 16px;
    }

    th, td {
        padding: 12px 10px;
    }
}

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

/* Touch-friendly spacing */
@media (hover: none) and (pointer: coarse) {
    /* This targets touch devices */
    .btn, a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 8px 5px;
    }
}

/* Landscape phone optimization */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        font-size: 14px;
    }

    .navbar {
        padding: 5px 10px;
    }

    .container {
        padding: 10px;
    }
}

/* Landing page cards */
.landing-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #4dabf7;
}

.landing-card {
    background: rgba(30, 30, 30, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.landing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.landing-card:hover .landing-icon {
    color: #74c0fc;
}

.landing-card .card-title {
    color: #fff;
}

.landing-card .card-text {
    color: rgba(255, 255, 255, 0.7);
}

/* Hunting indicator (tournaments) */
.hunting-indicator {
    cursor: pointer;
    font-size: 1.2em;
    margin-left: 5px;
    transition: transform 0.2s ease;
}

.hunting-indicator:hover {
    transform: scale(1.3);
}

.hunting-indicator[title]:hover::after {
    transition-delay: 0s !important;
}

/* Hunters modal list items (most_wanted + tournaments) */
#huntersModal .list-group-item,
#tournamentHuntersModal .list-group-item {
    border-left: 4px solid #007bff;
    margin-bottom: 5px;
    background: rgba(50, 50, 50, 0.8) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.1);
}

#huntersModal .list-group-item:hover,
#huntersModal .list-group-item:active,
#huntersModal .list-group-item:focus,
#tournamentHuntersModal .list-group-item:hover {
    background: rgba(70, 70, 70, 0.9) !important;
    color: #fff !important;
}

/* Versus page */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    background-color: rgba(40, 40, 40, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: none;
    border-radius: 0 0 4px 4px;
    display: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.autocomplete-results.show {
    display: block;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: rgba(0, 123, 255, 0.5);
}

.autocomplete-item small {
    color: #aaa;
    display: block;
    margin-top: 3px;
}

.autocomplete-item .match-highlight {
    background-color: rgba(255, 193, 7, 0.4);
    font-weight: bold;
}

/* Bottom border on all tables */
table {
    border-bottom: 1px solid #666;
}

/* Head-to-head match history table */
.table-h2h tr:nth-child(odd) td {
    background: transparent !important;
}

.table-h2h .table-success td {
    background-color: rgba(40, 167, 69, 0.25) !important;
    color: #fff !important;
}

.table-h2h .table-danger td {
    background-color: rgba(220, 53, 69, 0.25) !important;
    color: #fff !important;
}

/* Versus win/loss row colors (general) */
.table-success,
.table-success td {
    background-color: rgba(40, 167, 69, 0.3) !important;
    color: #fff !important;
}

.table-danger,
.table-danger td {
    background-color: rgba(220, 53, 69, 0.3) !important;
    color: #fff !important;
}

/* Key-value stat tables - th looks like td */
.table-stats th {
    background: rgba(40, 40, 40, 0.8) !important;
    font-weight: 600;
    color: #fff !important;
    position: static !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}

.table-stats tr:nth-child(odd) th {
    background: rgba(70, 70, 70, 0.6) !important;
}

.table-stats tr:hover th {
    background: rgba(70, 70, 70, 0.8) !important;
}

.form-control option {
    background-color: #333 !important;
    color: #fff !important;
}
