/* ============================
   GLOBAL RESET & BASE
============================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", Arial, Helvetica, sans-serif;
    background-color: #0a0a0a;
    background-image: url('../images/horse_banner.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: center top;
    color: #d0d0d0;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
}
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.72);
    z-index: 0;
    pointer-events: none;
}
.container, nav, .hero, .race, .bonus-question, .floating-card {
    position: relative;
    z-index: 1;
}

/* ============================
   HEADER BANNER / HERO
============================ */
.hero {
    position: relative;
    width: 100%;
    height: 220px;
    background-image: url('../images/horse_banner.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    text-align: center;
}
.hero::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
}
.hero h1 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    color: #f5c842;
    font-weight: 700;
    font-size: 2.5rem;
    text-shadow: 1px 1px 8px rgba(0,0,0,0.8);
    z-index: 1;
    white-space: nowrap;
}

/* ============================
   NAVIGATION
============================ */
nav {
    background: rgba(10,10,10,0.92);
    color: #f5c842;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(245,200,66,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(6px);
}
nav div:first-child {
    font-size: 15px;
    font-weight: 700;
    color: #f5c842;
    letter-spacing: 0.5px;
}
.nav-button {
    padding: 7px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    display: inline-block;
    transition: all 0.2s ease;
    margin-left: 4px;
}
.nav-button.green {
    background: #f5c842;
    color: #0a0a0a;
    border: 1px solid #f5c842;
}
.nav-button.green:hover {
    opacity: 0.85;
}
.nav-button.logout {
    background: none;
    color: #f5c842;
    border: 1px solid rgba(245,200,66,0.35);
}
.nav-button.logout:hover {
    border-color: #f5c842;
    background: rgba(245,200,66,0.08);
}

/* ============================
   PAGE CONTAINER / CARDS
============================ */
.container {
    max-width: 780px;
    margin: 30px auto;
    padding: 0 16px 60px 16px;
}
.signup-page .container.floating-card {
    max-width: 460px;
    margin: 30px auto 60px auto;
    background: rgba(20,20,20,0.95);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 30px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

h2 {
    color: #f5c842;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 28px 0 14px 0;
    text-transform: uppercase;
}

/* ============================
   RACE CARDS
============================ */
.race {
    background: rgba(15,15,15,0.92);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    color: #d0d0d0;
}
.race h3 {
    color: #f5c842;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}
.race p {
    margin: 4px 0 12px 0;
    color: #555;
    font-size: 13px;
}
.race .finished {
    color: #555;
    font-style: italic;
    font-size: 13px;
}

/* ============================
   INPUTS & FORMS
============================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    margin: 6px 0 16px 0;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: rgba(245,200,66,0.5);
}
input::placeholder, textarea::placeholder {
    color: #444;
}
select option {
    background: #1a1a1a;
    color: #e0e0e0;
}
.profile-section-title {
    color: #555;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 20px 0 4px 0;
}

/* ============================
   BUTTONS
============================ */
.btn-primary {
    width: 100%;
    background: #f5c842;
    border: none;
    color: #0a0a0a;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-danger {
    background: #c0392b;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.btn-danger:hover { background: #a93226; }

/* ============================
   MESSAGES / ALERTS
============================ */
.success {
    background: rgba(39,174,96,0.15);
    border: 1px solid rgba(39,174,96,0.3);
    color: #2ecc71;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.error {
    background: rgba(231,76,60,0.15);
    border: 1px solid rgba(231,76,60,0.3);
    color: #e74c3c;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
}

/* ============================
   TABLES / LEADERBOARD
============================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}
th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
th {
    color: #f5c842;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
td { color: #d0d0d0; }
tr:last-child td { border-bottom: none; }

/* ============================
   BONUS QUESTIONS
============================ */
.bonus-question {
    background: rgba(15,15,15,0.92);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.bonus-question h3 {
    color: #e0e0e0;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* ============================
   COLLAPSIBLE TOGGLES
============================ */
.collapsible-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    color: #f5c842;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 12px;
}
.collapsible-toggle .arrow {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 10px;
    color: #555;
}
.collapsible-toggle.open .arrow { transform: rotate(90deg); }
.collapsible-content { display: none; margin-top: 8px; }
.collapsible-content.open { display: block; }

/* ============================
   PICKS / HORSE ROWS
============================ */
.horse-pick-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: #888;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.horse-pick-btn:hover {
    border-color: #f5c842;
    color: #f5c842;
}
.horse-name-text {
    font-size: 14px;
    color: #d0d0d0;
}
.horse-name-text.picked {
    background: #f5c842;
    color: #0a0a0a;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 700;
}

/* ============================
   RESULTS
============================ */
.result-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 14px;
}
.result-row:last-child { border-bottom: none; }
.result-pos {
    font-size: 12px;
    font-weight: 700;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.pos-1 { color: #f5c842; }
.pos-2 { color: #aaaaaa; }
.pos-3 { color: #cd7f32; }
.pos-other { color: #444; }
.result-horse { font-size: 14px; color: #d0d0d0; flex: 1; display: flex; align-items: center; gap: 8px; }
.result-winner { color: #f5c842; font-weight: 700; }
.result-mypick { text-decoration: underline; text-underline-offset: 3px; }
.result-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
}
.badge-win { background: rgba(46,204,113,0.15); color: #2ecc71; }
.badge-lose { background: rgba(231,76,60,0.15); color: #e74c3c; }
.nr-badge {
    font-size: 10px;
    font-weight: 700;
    background: rgba(231,76,60,0.15);
    color: #e74c3c;
    border-radius: 4px;
    padding: 1px 5px;
}
.result-row-nr { opacity: 0.55; }

/* ============================
   ADMIN PANEL
============================ */
.admin-section { margin-bottom: 30px; }
.admin-button {
    background: #f5c842;
    color: #0a0a0a;
    border: none;
    font-size: 13px;
    padding: 6px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin: 2px;
    font-weight: 600;
}
.admin-button:hover { opacity: 0.85; }

/* ============================
   CHAT
============================ */
.chat-wrap {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 400px;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 16px;
}
.chat-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    position: relative;
}
.chat-message.mine {
    align-self: flex-end;
    background: rgba(245,200,66,0.08);
    border-color: rgba(245,200,66,0.15);
}
.chat-message.theirs {
    align-self: flex-start;
    background: rgba(255,255,255,0.04);
}
.chat-name {
    font-size: 11px;
    font-weight: 700;
    color: #f5c842;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.chat-text {
    font-size: 14px;
    color: #d0d0d0;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-time {
    font-size: 11px;
    color: #444;
    margin-top: 4px;
    text-align: right;
}
.chat-date-divider {
    text-align: center;
    font-size: 11px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-date-divider::before,
.chat-date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.06);
}
.chat-delete {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    margin-left: 8px;
    vertical-align: middle;
    opacity: 0.6;
}
.chat-delete:hover { opacity: 1; }
.char-count {
    font-size: 11px;
    color: #444;
    text-align: right;
}

/* ============================
   PODIUM / LEADERBOARD
============================ */
.podium-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    margin: 16px 0 8px 0;
}
.podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 120px;
}
.podium-name {
    font-size: 12px;
    font-weight: 700;
    color: #d0d0d0;
    text-align: center;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.podium-points { font-size: 11px; color: #555; margin-bottom: 6px; }
.podium-block {
    width: 100%;
    border-radius: 6px 6px 0 0;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
}
.podium-medal { font-size: 22px; }

/* ============================
   MISC
============================ */
.pick-you { color: #f5c842; }
.pick-summary-name { font-size: 13px; color: #666; }
.pick-summary-horse { font-size: 13px; color: #555; flex: 1; }
.horse-info-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    color: #555;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.horse-info-btn:hover { border-color: #f5c842; color: #f5c842; }
.horse-info-panel {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 8px;
    display: none;
}
.horse-info-panel.show { display: block; }
.horse-info-label { font-size: 10px; color: #444; text-transform: uppercase; letter-spacing: 0.5px; }
.horse-info-value { font-size: 13px; color: #d0d0d0; margin-bottom: 6px; }
.feedback-label { font-size: 11px; color: #444; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 10px; }
.feedback-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.feedback-btn:hover { opacity: 1; }
.feedback-count { font-size: 12px; color: #444; vertical-align: middle; }

/* ============================
   FORGOT PASSWORD
============================ */
.forgot-loin-details-links {
    margin-top: 15px;
    text-align: center;
}
.forgot-loin-details-links a {
    color: #555;
    font-size: 13px;
    text-decoration: none;
}
.forgot-loin-details-links a:hover { color: #f5c842; }

/* ============================
   MOBILE
============================ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (max-width: 800px) {
    body { font-size: 15px; }
    .hero { height: 150px; }
    .hero h1 { font-size: 1.6rem; white-space: normal; width: 85%; text-align: center; }
    .container { margin: 10px 12px 40px 12px; padding: 0 4px 40px 4px; }
    .signup-page .container.floating-card { margin: 10px 16px; }
    h2 { font-size: 13px; }
    .nav-button { padding: 6px 10px; font-size: 12px; margin-left: 3px; }
    .race h3 { font-size: 14px; }
    table th, table td { font-size: 12px; padding: 8px; }
    .podium-name { font-size: 11px; }
}
