/* US Soccer Directory - Brand Stylesheet */

/* ===== CSS Variables (Brand Colors) ===== */
:root {
    --navy-dark: #1a2a4a;
    --navy: #1e3a5f;
    --navy-light: #2d4a6f;
    --red: #c8102e;
    --red-dark: #a00d24;
    --red-light: #e8354d;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #212529;

    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--navy-dark);
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--navy);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--red);
}

/* ===== Header & Navigation ===== */
.header {
    background: var(--navy-dark);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo-text {
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
}

.logo-text span {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
    letter-spacing: 0.05em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-menu a {
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: var(--red);
    color: var(--white);
}

/* Mobile menu toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
    color: var(--white);
    padding: 4rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    border: 2px solid var(--red);
    border-radius: 50%;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    margin: 0 0.25rem;
}

.btn-primary {
    background-color: var(--red);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--red-dark);
    color: var(--white);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--navy-dark);
}

.btn-secondary:hover {
    background-color: var(--gray-100);
    color: var(--navy-dark);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline:hover {
    background-color: var(--white);
    color: var(--navy-dark);
}

/* ===== Main Content ===== */
main {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header p {
    color: var(--gray-500);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Cards ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.card-text {
    color: var(--gray-500);
    margin-bottom: 1rem;
}

/* ===== Stats Section ===== */
.stats {
    background: var(--gray-100);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item {
    padding: 1.5rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--navy-dark);
    line-height: 1;
}

.stat-label {
    color: var(--gray-500);
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

th {
    background: var(--navy-dark);
    color: var(--white);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

tr:hover {
    background: var(--gray-100);
}

/* ===== Search & Filters ===== */
.search-box {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--navy);
}

/* ===== Forms ===== */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem 3rem;
}

.form-section {
    margin-bottom: 2.5rem;
}

.form-section:last-of-type {
    margin-bottom: 2rem;
}

.form-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-200);
    color: var(--navy-dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
    font-size: 0.95rem;
}

label.required::after {
    content: ' *';
    color: var(--red);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group select,
.form-group textarea,
.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    background-color: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-input::placeholder {
    color: var(--gray-400);
}

.form-group textarea,
textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-row .form-group {
    margin-bottom: 1.5rem;
}

.form-help {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
}

.form-error {
    color: var(--red);
    font-size: 0.85rem;
    margin-top: 0.375rem;
}

.form-error ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* File input styling */
.form-group input[type="file"] {
    padding: 0.75rem 1rem;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    background-color: var(--gray-100);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-group input[type="file"]:hover {
    border-color: var(--navy);
    background-color: var(--gray-200);
}

.form-group input[type="file"]:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Form submit button */
.form-container .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .form-container {
        padding: 1.5rem;
        margin: 0 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ===== Tags & Badges ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-navy {
    background: var(--navy);
    color: var(--white);
}

.badge-red {
    background: var(--red);
    color: var(--white);
}

.badge-gray {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* ===== Footer ===== */
.footer {
    background: var(--navy-dark);
    color: var(--white);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    display: block;
    padding: 0.25rem 0;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

/* ===== Pyramid Page ===== */
.pyramid-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.pyramid-level {
    display: block;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 0 auto;
    border: 1px solid var(--gray-200);
}

/* Progressive width for pyramid levels */
.pyramid-level[style*="--level: 1"] { width: 50%; }
.pyramid-level[style*="--level: 2"] { width: 58%; }
.pyramid-level[style*="--level: 3"] { width: 66%; }
.pyramid-level[style*="--level: 4"] { width: 74%; }
.pyramid-level[style*="--level: 5"] { width: 82%; }
.pyramid-level[style*="--level: 6"] { width: 90%; }
.pyramid-level[style*="--level: 7"] { width: 95%; }
.pyramid-level[style*="--level: 8"] { width: 98%; }
.pyramid-level[style*="--level: 9"] { width: 100%; }

.pyramid-level:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--navy);
}

.pyramid-level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.pyramid-level-number {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--navy-dark);
}

.pyramid-level-count {
    font-size: 0.875rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

.pyramid-level-leagues {
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.5;
}

.pyramid-league-name {
    white-space: nowrap;
}

/* Pyramid Navigation */
.pyramid-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.pyramid-nav-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 100px;
}

.pyramid-nav-arrow {
    font-size: 1.25rem;
    line-height: 1;
}

.pyramid-nav-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .hero {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--navy-dark);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        padding: 1rem;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-toggle {
        display: block;
    }

    .section {
        padding: 2rem 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Pyramid mobile styles */
    .pyramid-level {
        width: 100% !important;
    }

    .pyramid-level-leagues {
        font-size: 0.85rem;
    }

    .pyramid-nav {
        flex-direction: column;
        gap: 0.75rem;
    }

    .pyramid-nav-btn {
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }
}

/* ===== Match Results ===== */
.match-score {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    background: var(--gray-100);
    font-variant-numeric: tabular-nums;
}

.match-score.home-win {
    background: rgba(34, 139, 34, 0.1);
    color: #228b22;
}

.match-score.away-win {
    background: rgba(200, 16, 46, 0.1);
    color: var(--red);
}

.match-score.draw {
    background: var(--gray-100);
    color: var(--gray-600);
}
