/* Base Variables */
:root {
    --primary-color: #04AA6D;
    /* W3Schools Green */
    --primary-hover: #059862;
    --text-color: #000;
    --bg-color: #fff;
    --card-bg: #f1f1f1;
    --border-color: #ddd;
    --sidebar-width: 250px;
    --header-height: 60px;
    --font-family: 'Segoe UI', Arial, sans-serif;
}

[data-theme="dark"] {
    --text-color: #fff;
    --bg-color: #1d2a35;
    /* Dark bluish gray */
    --card-bg: #38444d;
    --border-color: #555;
    --primary-color: #FFD700;
    /* Golden */
    font-weight: bold;
}

/* Reset & Scaffolding */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    color: inherit;
}

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

/* Header */
.site-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 20px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* Sidebar Toggle (Mobile) */
.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 24px;
}

/* Content Layout */
.main-wrapper {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--card-bg);
    padding: 20px;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    z-index: 100;
    /* Ensure it stays below header but handles footer overlap better if needed */
}

/* Fix for Sidebar Overlapping Footer */
.main-wrapper {
    position: relative;
    z-index: 1;
}

.site-footer {
    position: relative;
    z-index: 200;
    /* Ensure footer overlays sidebar content if they collide, or push it down */
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.sidebar-nav a {
    display: block;
    padding: 10px;
    border-radius: 4px;
}

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

/* Explicit Override for Sidebar in Dark Mode to use Green (Light Mode Primary) instead of Yellow */
[data-theme="dark"] .sidebar-nav a:hover,
[data-theme="dark"] .sidebar-nav a.active {
    background-color: #04AA6D;
    /* Green */
    color: white;
    font-weight: bold;
}

.content-area {
    flex: 1;
    padding: 40px;
}

/* Content Block Typography */
.content-block h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.content-block h2 {
    font-size: 2rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.content-block h3 {
    font-size: 1.5rem;
    margin-top: 25px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.content-block p {
    margin-bottom: 15px;
    line-height: 1.8;
    font-size: 1.1rem;
}

.content-block ul,
.content-block ol {
    margin-bottom: 20px;
    margin-left: 20px;
    padding-left: 20px;
}

.content-block li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.content-block a {
    color: var(--primary-color);
    text-decoration: underline;
}

.content-block a:hover {
    color: var(--primary-hover);
}

/* Cards Grid */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.listing-card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #fff;
    padding: 5px;
    object-fit: contain;
}

.player-icon {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    /* Square with rounded corners */
    padding: 0;
    object-fit: cover;
    object-position: top;
    /* Focus on face */
    background: #e1e1e1;
}

.card-content h3 {
    margin-bottom: 5px;
    color: var(--primary-color);
    word-break: break-word;
    /* Prevent overflow */
}

[data-theme="dark"] .card-content h3 {
    color: var(--primary-color);
    text-shadow: 0px 0px 1px #998100;
}

.card-content p {
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 10px;
    word-break: break-word;
    /* Prevent overflow */
}

.card-link {
    font-size: 0.85em;
    color: var(--text-color);
    text-decoration: underline;
    word-break: break-all;
    /* Ensure URLs wrap */
}

/* Custom Action Buttons */
.copy-btn,
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: none;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* Dark Mode Button Overrides for High Contrast */
[data-theme="dark"] .copy-btn,
[data-theme="dark"] .action-btn {
    background-color: #04AA6D;
    /* Green from light mode */
    color: white;
    font-weight: bold;
}

[data-theme="dark"] .copy-btn:hover,
[data-theme="dark"] .action-btn:hover {
    background-color: #059862;
}

.copy-btn:hover,
.action-btn:hover {
    background-color: var(--primary-hover);
    color: white;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.social-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: color 0.2s;
}

.social-icon:hover {
    color: var(--primary-hover);
}

/* Stadium Actions */
/* Stadium Actions */
.stadium-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 5px;
    margin-top: 5px;
    /* Add space */
}

.stadium-actions .action-btn {
    font-size: 0.75rem;
    /* Smaller buttons to fit */
    padding: 3px 8px;
}

/* Horizontal Card */
.listing-card-horizontal {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: row;
    /* Force row */
    align-items: center;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    grid-column: 1 / -1;
    /* Full width in grid */
}

.listing-card-horizontal:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.listing-card-horizontal .card-icon {
    width: 80px;
    height: 80px;
    padding: 10px;
}

.listing-card-horizontal .card-content h3 {
    font-size: 1.5rem;
}

/* Footer */
.site-footer {
    background-color: var(--card-bg);
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    position: relative;
    z-index: 10;
}

/* Theme Toggle */
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
}

/* Responsive */
@media (max-width: 768px) {
    .main-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: calc(100vh - var(--header-height));
        position: fixed;
        top: var(--header-height);
        left: 0;
        z-index: 999;
        display: none;
        overflow-y: auto;
        background-color: var(--card-bg);
        border-right: none;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    /* Hidden by default on mobile, toggled via JS */
    .sidebar.active {
        display: block;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
    }

    /* Hide top nav links on mobile, maybe move to sidebar */
    .content-area {
        padding: 20px;
    }
}

/* Header Scroll Effect */
.site-header {
    transition: height 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    height: 50px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-logo {
    height: 40px;
    width: auto;
    max-width: 150px;
    transition: height 0.3s ease;
}

.site-header.scrolled .header-logo {
    height: 30px;
}