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

:root {
    /* Light Theme Palette */
    --bg-main: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-card: #ffffff;
    --primary: #059669; /* Slightly deeper Emerald for light theme */
    --primary-hover: #047857;
    --secondary: #d97706; /* Amber/Gold */
    --text-main: #0f172a; /* Dark Slate */
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --accent-red: #e11d48;
}

/* Base Styles */
html, body {
    background-color: var(--bg-main) !important;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .brand {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
}

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

/* Navbar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2.5rem;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

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

/* Hero Section */
.hero {
    padding: 4rem 0 2rem;
    text-align: center;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.04em;
}

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

/* Cards */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

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

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

.btn-outline:hover {
    background: var(--bg-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-top: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem 1.5rem;
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: white;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #fdfdfd;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
}

.status-online { background: #ecfdf5; color: #059669; border: 1px solid #d1fae5; }
.status-offline { background: #fff1f2; color: #e11d48; border: 1px solid #ffe4e6; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

/* Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }
label { display: block; margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.85rem; font-weight: 500; }
input, select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-main);
    transition: all 0.2s;
}
input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1); }

/* Animation */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }

/* Professional Table Layout for History */
.race-header-bar {
    background-color: #5b8db8;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    border-radius: 4px 4px 0 0;
}

.details-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-top: none;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.details-table th {
    background-color: #666666;
    color: white;
    padding: 0.4rem 0.6rem;
    text-align: center;
    font-weight: 500;
    border: 1px solid #999;
    white-space: nowrap;
}

.details-table td {
    padding: 0.4rem 0.6rem;
    text-align: center;
    border: 1px solid var(--border);
    color: #333;
    white-space: nowrap;
}

.details-table tr:hover td {
    background-color: #f0f7ff;
}

.silk-placeholder {
    width: 24px;
    height: 24px;
    background: #eee;
    border-radius: 3px;
    display: inline-block;
}

.strength-box {
    font-weight: 700;
    color: #555;
}

.star-rating {
    color: #f59e0b;
    display: flex;
    justify-content: center;
    gap: 1px;
}

.edit-btn {
    padding: 2px 4px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 3px;
    color: #166534;
    cursor: pointer;
}

.edit-btn:hover {
    background: #dcfce7;
}

.sectional-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* History Details Adjustments */
.pedigree-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
}

#live-feed {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-subtle);
}
