@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0b0f17;
    --bg-card: rgba(18, 25, 38, 0.85);
    --bg-input: rgba(11, 15, 23, 0.9);
    --border-color: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(197, 168, 128, 0.3); /* Champagne Gold border */
    
    --primary: #c5a880; /* Elegant Champagne Gold */
    --primary-glow: rgba(197, 168, 128, 0.15);
    --primary-dark: #a88d65;
    
    --secondary: #14532d; /* Classic Wimbledon Forest Green */
    --secondary-glow: rgba(20, 83, 45, 0.3);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    
    --success: #15803d;
    --error: #b91c1c;
    --warning: #d97706;
    
    --font-heading: 'Cinzel', serif; /* Serif elegant font for heading branding */
    --font-body: 'Inter', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(20, 83, 45, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 90% 100%, rgba(197, 168, 128, 0.03) 0%, transparent 40%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal page scrolling */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-main);
}

.text-gradient {
    background: linear-gradient(135deg, #ffffff 40%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-gold {
    background: linear-gradient(135deg, #fef08a 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Elegant Cards */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px; /* Sharper corners for a formal look */
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 6px 30px rgba(197, 168, 128, 0.03);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Allow grid content to shrink properly and prevent table horizontal stretch */
.grid-2 > *, .grid-3 > * {
    min-width: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    border-radius: 4px; /* Crisp borders */
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-transform: uppercase;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-dark);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background-color: transparent;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: #ef4444;
    color: white;
    transform: translateY(-1px);
}

/* Form Controls */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-main);
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}

.form-input:focus, .form-select:focus {
    border-color: var(--primary);
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    text-align: left;
}

.custom-table th {
    padding: 16px;
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Rankings Styles */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-weight: 700;
    font-family: var(--font-body);
    font-size: 0.85rem;
}

.rank-badge-1 {
    background: var(--primary);
    color: var(--text-dark);
}

.rank-badge-2 {
    background: #94a3b8;
    color: var(--text-dark);
}

.rank-badge-3 {
    background: #b45309;
    color: white;
}

.rank-badge-default {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-initiated { background: rgba(148, 163, 184, 0.1); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.2); }
.badge-intermediate { background: rgba(197, 168, 128, 0.1); color: var(--primary); border: 1px solid rgba(197, 168, 128, 0.2); }
.badge-advanced { background: rgba(20, 83, 45, 0.1); color: #4ade80; border: 1px solid rgba(20, 83, 45, 0.2); }

/* Navbar */
.navbar {
    background: #090c13;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 20px 0;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: 0.1em;
}

.navbar-nav {
    display: flex;
    gap: 30px;
    list-style: none;
    align-items: center;
}

.navbar-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.navbar-link:hover, .navbar-link.active {
    color: var(--primary);
}

/* Landing Page Specific styling */
.hero {
    padding: 100px 0;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: 0.05em;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 40px auto;
    font-family: var(--font-body);
}

/* Master Bracket Visualization */
.master-bracket-container {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    padding: 20px 0;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.bracket-match {
    width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.bracket-player {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.bracket-player:last-child {
    border-bottom: none;
}

.bracket-player.winner {
    background: rgba(197, 168, 128, 0.05);
    color: var(--primary);
    font-weight: 600;
}

/* Responsive & Mobile Design Overrides */
@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .glass-card {
        padding: 20px 16px;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .hero {
        padding: 40px 16px;
    }
    
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 24px;
    }
    
    .navbar-container {
        flex-direction: column;
        gap: 14px;
        align-items: center;
        text-align: center;
    }
    
    .navbar-nav {
        gap: 14px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .custom-table th, .custom-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    /* Optimize scorecard fields for narrow screens */
    .form-group div[style*="display: flex"] {
        flex-wrap: wrap;
    }
}

/* Searchable Select Widget Styles */
.searchable-select-container {
    position: relative;
    width: 100%;
}

.searchable-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    background: var(--bg-dark);
    border: 1px solid var(--primary);
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    display: none;
}

.searchable-select-options.show {
    display: block;
}

.searchable-select-option {
    padding: 12px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.searchable-select-option:last-child {
    border-bottom: none;
}

.searchable-select-option:hover {
    background: rgba(197, 168, 128, 0.1);
    color: var(--primary);
}

.searchable-select-option.selected {
    background: rgba(197, 168, 128, 0.15);
    color: var(--primary);
    font-weight: 600;
}

