/* components.css — Score display, event cards, records, modals, snackbar, tabs */

/* Score display card */
.score-display {
    background: var(--card-bg);
    border: 1px solid var(--card-stroke);
    border-radius: 16px; padding: 24px;
    text-align: center; margin-bottom: 20px;
}
.score-big { font-size: 48px; font-weight: 700; }
.score-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Event score summary grid */
.event-scores {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 8px; margin-top: 16px;
}
.event-score-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px; padding: 10px 4px; text-align: center;
}
.event-score-item .val { font-size: 18px; font-weight: 700; }
.event-score-item .lbl { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.event-score-item .raw { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* Event card (individual event in calculator) */
.event-card {
    background: var(--card-bg);
    border: 1px solid var(--card-stroke);
    border-radius: 14px; padding: 16px; margin-bottom: 14px;
}
.event-card-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 10px;
}
.event-card-header h3 { font-size: 14px; font-weight: 700; }
.event-pts { font-size: 22px; font-weight: 700; min-width: 40px; text-align: right; }
.event-pts.pass { color: #4CAF50; }
.event-pts.fail { color: var(--red); }

/* Records list */
.record-item {
    background: var(--card-bg);
    border: 1px solid var(--card-stroke);
    border-radius: 12px; padding: 16px; margin-bottom: 12px;
    display: flex; justify-content: space-between; align-items: center;
}
.record-info h3 { font-size: 15px; margin-bottom: 4px; }
.record-info p { font-size: 13px; color: var(--text-muted); }
.record-score {
    font-size: 24px; font-weight: 700;
    min-width: 60px; text-align: center;
}
.record-actions { display: flex; gap: 6px; margin-left: 12px; }
.record-actions button {
    background: rgba(255, 255, 255, 0.1); border: none;
    color: var(--text); width: 32px; height: 32px;
    border-radius: 8px; cursor: pointer; font-size: 14px;
}
.record-actions button.delete:hover { background: rgba(173, 27, 27, 0.5); }

/* Tabs */
.tabs {
    display: flex; margin-bottom: 20px;
    background: var(--card-bg); border-radius: 12px;
    border: 1px solid var(--card-stroke); overflow: hidden;
}
.tab {
    flex: 1; padding: 12px; text-align: center;
    font-size: 14px; font-weight: 700; cursor: pointer;
    background: transparent; border: none; color: var(--text-muted);
    transition: all 0.2s;
}
.tab.active { background: var(--accent); color: #fff; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 15px; margin-bottom: 20px; }

/* Snackbar */
.snackbar {
    position: fixed; bottom: -60px; left: 50%; transform: translateX(-50%);
    background: var(--snackbar-bg); color: #fff; padding: 12px 24px;
    border-radius: 12px; font-size: 14px; font-weight: 600;
    transition: bottom 0.3s; z-index: 200;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.snackbar.show { bottom: 24px; }

/* Login modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
    display: none; align-items: center; justify-content: center; z-index: 300;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--card-bg); border-radius: 20px;
    padding: 32px; width: 90%; max-width: 400px;
    text-align: center; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.modal h2 { margin-bottom: 8px; font-size: 22px; }
.modal p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.modal .google-btn {
    background: #fff; color: #333; border: none;
    padding: 12px 24px; border-radius: 12px; font-size: 15px;
    font-weight: 700; cursor: pointer; width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 12px;
}
.modal .close-modal {
    background: none; border: none; color: var(--text-muted);
    margin-top: 16px; cursor: pointer; font-size: 14px;
}

/* Responsive overrides */
@media (max-width: 400px) {
    .event-scores { grid-template-columns: repeat(3, 1fr); }
}

/* ── Login Modal Additions ─────────────── */
/* Append these to components.css          */

.login-error {
    background: rgba(173, 27, 27, 0.15);
    border: 1px solid #ad1b1b;
    color: #ff6b6b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 12px;
    text-align: left;
}

.login-form {
    width: 100%;
    margin-top: 8px;
}

.login-form .form-group {
    margin-bottom: 12px;
    text-align: left;
}

.login-form label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 4px;
    opacity: 0.7;
}

.login-form input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.login-submit-btn {
    width: 100%;
    padding: 12px;
    margin-top: 4px;
    font-size: 1rem;
    font-weight: 600;
}

.login-meta {
    text-align: right;
    margin-top: 8px;
    font-size: 0.8rem;
}

.login-meta a {
    color: var(--accent);
    text-decoration: none;
}

.login-meta a:hover {
    text-decoration: underline;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    width: 100%;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.15);
}

.login-divider span {
    padding: 0 12px;
    font-size: 0.8rem;
    opacity: 0.5;
    text-transform: uppercase;
}

.login-toggle {
    margin-top: 14px;
    font-size: 0.85rem;
    opacity: 0.8;
}

.login-toggle a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.login-toggle a:hover {
    text-decoration: underline;
}

/* Light theme adjustments */
[data-theme="light"] .login-form input {
    border-color: rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.5);
}

[data-theme="light"] .login-error {
    background: rgba(173, 27, 27, 0.1);
    color: #ad1b1b;
}

[data-theme="light"] .login-divider::before,
[data-theme="light"] .login-divider::after {
    background: rgba(0,0,0,0.15);
}

/* ── Records Page ──────────────────────── */
/* Append these to components.css          */

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 4px;
}

.tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
}

.tab.active {
    background: var(--accent);
    color: #fff;
    opacity: 1;
}

.record-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}

.record-info {
    flex: 1;
    min-width: 0;
}

.record-info h3 {
    margin: 0;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-info p {
    margin: 4px 0 0;
    font-size: 0.8rem;
    opacity: 0.6;
}

.record-score {
    font-size: 1.4rem;
    font-weight: 800;
    min-width: 48px;
    text-align: center;
}

.record-score.pass { color: #096e0b; }
.record-score.fail { color: #ad1b1b; }

.record-actions {
    display: flex;
    gap: 6px;
}

.record-actions button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: inherit;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    opacity: 0.7;
    transition: all 0.2s;
}

.record-actions button:hover {
    opacity: 1;
}

.record-actions button.delete:hover {
    border-color: #ad1b1b;
    color: #ad1b1b;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    opacity: 0.6;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.empty-state p {
    margin: 8px 0 20px;
}

/* Light theme */
[data-theme="light"] .tabs {
    background: rgba(0,0,0,0.05);
}

[data-theme="light"] .record-item {
    border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .record-actions button {
    border-color: rgba(0,0,0,0.15);
}