body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f4f7f6;
}

.container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
}

.selection-section {
    margin-bottom: 30px;
    text-align: center;
}

label {
    font-weight: bold;
    margin-right: 10px;
}

.autocomplete-wrapper {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

#federation-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

#federation-input:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

#federation-input::placeholder {
    color: #a0aec0;
}

.content-display {
    border-top: 1px solid #eee;
    padding-top: 20px;
    overflow-x: auto;
}

.error {
    color: #e74c3c;
    font-weight: bold;
}

.back-btn {
    padding: 10px 20px;
    margin-bottom: 20px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.back-btn:hover {
    background-color: #34495e;
}

.content-display h2 {
    color: #2c3e50;
    margin: 20px 0 10px 0;
}

/* Tooltip & Popup Styling */
.catur-skor-popup {
    position: fixed;
    z-index: 10000;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    padding: 15px;
    min-width: 280px;
    font-size: 13px;
    pointer-events: none;
    display: none;
    border: 1px solid #eee;
    color: #333;
    font-family: system-ui, -apple-system, sans-serif;
}

.catur-skor-popup table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.catur-skor-popup th {
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    text-align: left;
}

.catur-skor-popup td {
    padding: 6px 0;
    border-bottom: 1px solid #f9f9f9;
}

.pop-res { font-weight: bold; }
.pop-win { color: #2ecc71; }
.pop-loss { color: #e74c3c; }
.pop-draw { color: #f1c40f; }

.player-name-cell {
    cursor: help;
}

.player-name-cell:hover {
    background-color: #f0f7ff !important;
}

.res-active {
    cursor: help !important;
    pointer-events: all !important;
}

/* Cached Section Styling */
.cached-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #edf2f7;
}

.cached-section h2 {
    font-size: 18px;
    color: #2d3748;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f7fafc;
}

.cache-country-group {
    margin-bottom: 15px;
}

.cache-country-group h3 {
    font-size: 14px;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    background: #f7fafc;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
}

.cache-country-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cache-country-group a {
    color: #3182ce;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    display: inline-block;
    transition: all 0.2s;
}

.cache-country-group a:hover {
    background: #ebf8ff;
    border-color: #bee3f8;
    color: #2c5282;
    transform: translateY(-1px);
}

/* Tournament Summary */
.tournament-summary {
    background: #fdfdfd;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2c3e50;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
    line-height: 1.6;
    color: #2d3748;
}

.tournament-summary h4 {
    margin: 0 0 10px 0;
    color: #1a202c;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 14px;
}

.summary-section {
    margin-bottom: 8px;
}

.summary-label {
    font-weight: bold;
    color: #4a5568;
    min-width: 140px;
    display: inline-block;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    z-index: 5000;
    border-radius: 12px 12px 0 0;
}

.nav-item {
    text-decoration: none;
    color: #718096;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 4px 12px;
    border-radius: 20px;
}

.nav-item:hover {
    color: #3182ce;
}

.nav-item.active {
    background-color: #ebf8ff;
    color: #2b6cb0;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
}

.material-symbols-outlined {
    font-size: 24px;
}

/* Adjust body padding for fixed footer */
body {
    padding-bottom: 80px;
}

/* Compact Header Layout */
body {
    padding-top: 70px; /* Space for fixed header */
}

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    z-index: 6000;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.header-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    margin: 0;
    color: #2d3748;
    white-space: nowrap;
}

.header-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.selection-section {
    margin-bottom: 0;
}

.autocomplete-wrapper {
    display: flex;
    align-items: center;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 0 12px;
    width: 200px;
    transition: width 0.3s;
}

.autocomplete-wrapper:focus-within {
    width: 260px;
    background: #fff;
    border-color: #3182ce;
}

#federation-input {
    background: transparent;
    border: none;
    padding: 8px;
    font-size: 14px;
    width: 100%;
    box-shadow: none !important;
}

.search-icon {
    font-size: 18px;
    color: #a0aec0;
}

.header-btn {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #4a5568;
    transition: all 0.2s;
}

.header-btn:hover {
    background: #edf2f7;
    color: #2d3748;
}

.cache-menu-wrapper {
    position: relative;
}

.cache-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    padding: 15px;
}

.cache-menu-wrapper:hover .cache-dropdown {
    display: block;
}

.cache-dropdown h2 {
    font-size: 14px;
    margin-top: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #f7fafc;
}

@media (max-width: 600px) {
    .btn-text { display: none; }
    .autocomplete-wrapper { width: 140px; }
    .autocomplete-wrapper:focus-within { width: 180px; }
    .logo { font-size: 16px; }
}

/* Hide original h2 when title is in logo */
.catur-skor-wrapper h2 {
    display: none;
}
