﻿/* Global dark theme */
:root {
    --bg-main: #020617; /* near-black, slate */
    --bg-card: #020617;
    --bg-card-elevated: #020617;
    --bg-card-soft: rgba(15, 23, 42, 0.9);
    --border-subtle: #1e293b;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --accent: #22c55e; /* green accent */
    --accent-soft: rgba(34, 197, 94, 0.18);
    --danger: #f97373;
}

/* Base / layout */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    background: radial-gradient(circle at top, #0f172a 0, #020617 55%, #000 100%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: stretch;
    min-height: 100vh;
}

/* Full-screen shell so we can add background glow etc. */
.hero-shell {
    position: relative;
    width: 100%;
    padding: 24px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Soft glow behind the card */
.hero-bg-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 20% 0%, rgba(34, 197, 94, 0.18), transparent 55%), radial-gradient(circle at 80% 20%, rgba(56, 189, 248, 0.16), transparent 55%);
    opacity: 0.85;
}

/* Main card */
.container {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 24px 22px 20px;
    background: var(--bg-card-soft);
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(15, 23, 42, 0.8);
    text-align: left;
    backdrop-filter: blur(16px);
    z-index: 1;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background-color: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Header / logo */
.logo {
    font-size: 2.3rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
    color: #f9fafb;
}

.tagline {
    margin: 0 0 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.tagline .accent {
    color: var(--accent);
    font-weight: 600;
}

/* Feature bullet list */
.feature-list {
    list-style: none;
    margin: 1.25rem 0 1.75rem;
    padding: 0;
    font-size: 0.95rem;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

/* Green check icon before each item */
.feature-list li::before {
    content: "✓";
    flex-shrink: 0;
    font-weight: 700;
    margin-top: 0.1rem;
    color: #22c55e; /* tweak to match your accent */
}

/* Button stack */
.button-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

/* Shared auth button styles */
.auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    background: #020617;
    color: var(--text-main);
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

    .auth-button:active {
        transform: scale(0.98);
    }

/* Logo placeholder inside buttons */
.logo-placeholder {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
}

/* Google specific */
.google-button {
    background: #f9fafb;
    color: #111827;
    border-color: #e5e7eb;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
}

    .google-button .logo-placeholder {
        background-color: transparent;
        color: #4285f4;
    }

    .google-button:hover {
        background: #ffffff;
        border-color: #d1d5db;
    }

/* Apple specific */
.apple-button {
    background: #020617;
    color: #f9fafb;
    border-color: #111827;
}

    .apple-button .logo-placeholder {
        background-color: #ffffff;
        color: #000000;
    }

    .apple-button:hover {
        background: #020617;
        border-color: #374151;
    }

/* Primary (green) button */
.primary-button {
    background: linear-gradient(135deg, var(--accent), #16a34a);
    border-color: transparent;
    color: #022c22;
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.4), 0 0 0 1px rgba(22, 101, 52, 0.6);
}

    .primary-button:hover {
        box-shadow: 0 14px 30px rgba(34, 197, 94, 0.55), 0 0 0 1px rgba(22, 101, 52, 0.9);
    }

/* Separator */
.separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 14px 0 14px;
}

    .separator::before,
    .separator::after {
        content: "";
        flex: 1;
        border-bottom: 1px dashed rgba(75, 85, 99, 0.8);
    }

    .separator::before {
        margin-right: 0.6em;
    }

    .separator::after {
        margin-left: 0.6em;
    }

/* Email form */
.email-form {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 18px;
}

.email-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid #1f2937;
    background: #020617;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

    .email-input::placeholder {
        color: #6b7280;
    }

    .email-input:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 1px var(--accent-soft);
        background: #020617;
    }

/* Demo block (your weather/recommendations button & status) */
.demo-block {
    padding: 10px 12px 8px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(30, 64, 175, 0.5);
    margin-bottom: 16px;
}

.secondary-action {
    width: 100%;
    margin-bottom: 6px;
}

.status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-height: 1.2em;
    margin-top: 2px;
    word-break: break-word;
}

/* Footnote */
.footnote {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: left;
}

/* Links */
a {
    color: var(--accent);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

/* Responsive tweaks */
@media (min-width: 640px) {
    .hero-shell {
        padding: 32px 24px;
    }

    .container {
        padding: 28px 26px 22px;
    }
}

.apple-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.apple-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.brand-logo {
    width: 96px;
    height: auto;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6));
}

.brand-text {
    align-items: center;
}

.brand-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
}

    .brand-centered .badge {
        margin: 0;
        text-align: center;
    }

    .brand-centered .logo {
        text-align: center;
        margin: 0;
    }

/* Optional: tighten badge spacing when used here */
.brand-text .badge {
    margin-bottom: 4px;
}

/* If you want the word 'Rovinaut' a bit larger in this context */
.brand-text .logo {
    margin-bottom: 0;
}


/* Wrapper that holds the rotating background images */
.background-rotator {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

/* Two layers we crossfade between */
.bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

/* Active layer is visible */
.bg-layer.is-visible {
    opacity: 1;
}

/* Optional: dark overlay via ::after so text is readable */
.bg-layer::after {
    content: none;
}

/* Your page content goes above the background */
.page-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-wrapper {
    position: relative;
    display: inline-block;
}

.logo-base {
    width: 80px;
    height: auto;
}

.logo-hat {
    position: absolute;
    top: -12px; 
    left: 20px; 
    width: 36px; 
    height: auto;
    pointer-events: none;
    display: none; /* hidden unless December */
}


/* --- Application Page Components (To be added to site.css) --- */

/* 1. App Card Container (Similar to .container but without centered layout) */
.app-page-container {
    width: 100%;
    max-width: 768px; /* Wider card for dashboard content */
    margin: 40px auto;
    padding: 30px;
    background: var(--bg-card-soft);
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1;
}

/* 2. Headers and text */
.app-dashboard h2 {
    color: var(--text-main);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.status-message {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

/* 3. List Groups (Configured Sports List) */
.list-group {
    padding: 0;
    list-style: none;
    margin-bottom: 25px;
    border-radius: 12px;
    overflow: hidden;
}

.list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
}

    .list-group-item:last-child {
        border-bottom: none;
    }

.badge {
    /* Uses existing .badge style, but ensure float-end/ms-2 is handled by flex/gap */
    color: var(--accent);
    background-color: var(--accent-soft);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

/* 4. Form/Input Styles (Applies to AddSport and potentially Login form inputs) */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px; /* Slightly squarer than login buttons */
    border: 1px solid var(--border-subtle);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

/* Primary buttons for forms (uses existing primary-button style) */
.btn-primary {
    /* inherits .primary-button styles */
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
}

.btn-secondary {
    background-color: var(--border-subtle);
    color: var(--text-muted);
    border: 1px solid #374151;
    padding: 10px 20px;
    border-radius: 999px;
    text-decoration: none;
    display: block;
    text-align: center;
}

/* The full-screen backdrop that dims the background */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    /* FIX 1: MUST be hidden by default */
    display: none;
    /* FIX 2: Ensure content alignment when visible */
    justify-content: center;
    align-items: center;
    /* Use opacity for smoother hiding/showing via JS classes */
    opacity: 0;
    display: none;
}

/* State when the modal is open */
.modal-overlay.is-visible {
    /* When active, show the overlay and fade it in */
    display: flex;
    opacity: 1;
}

.modal-overlay .modal-content-box {
    /* Set the starting (hidden) state */
    transform: translateY(20px);
    opacity: 0;
}

.modal-overlay.is-visible .modal-content-box {
    /* Apply visible style here (transform and opacity) */
    transform: translateY(0);
    opacity: 1;
}

/* The actual modal content box */
.modal-content-box {
    position: relative;
    width: 90%;
    max-width: 500px;
    padding: 25px;
    background: var(--bg-card-soft);
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    color: var(--text-main);
    /* FIX: Initial state should be invisible/displaced on the content box */
    /* We still define the transition property here: */
    transition: opacity 0.3s ease, transform 0.3s ease;
    /* We rely on .modal-overlay.is-visible to set opacity/transform! */
}


.modal-content-box h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Modal-specific button styling (e.g., close button) */
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Adapted list styling for the modal */
.modal-list-group {
    list-style: none;
    padding: 0;
    margin: 10px 0 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.modal-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
}

    .modal-list-item:last-child {
        border-bottom: none;
    }


/* --- ICON LAYOUT FIXES (REPLACING D-FLEX & GAP) --- */

.sport-icon-summary {
    display: flex;
    flex-wrap: wrap; /* wrap nicely on small screens */
    gap: 1.75rem; /* more breathing room between tiles */
    margin-top: 12px;
    align-items: flex-start;
}

.sport-item-container {
    flex-shrink: 0;
    width: 96px; /* a bit larger than before */
    text-align: center;
}

.sport-remove-form {
    display: block; /* Allows proper positioning */
    position: relative; /* Replaces Bootstrap's position-relative */
}

/* --- ADD SPORT BUTTON STYLES (MATCHING ICON SIZE) --- */

.add-sport-button {
    flex-shrink: 0;
    display: flex; /* Allows the + and text to stack */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100px; /* Matching the height of the icon wrapper + skill level */
    width: 80px;
    /* Add styling to make it look like a button */
    padding: 10px 0;
    border-radius: 8px;
}


/* --- DELETE BUTTON STYLES (REPLACING BTN-CLOSE & POSITION UTILITIES) --- */

.sport-icon-wrapper {
    position: relative;
    display: block;
    width: 96px;
    height: 96px;
    margin-bottom: 6px;
    border-radius: 12px;
    overflow: hidden;
    background: #020617;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
}

.sport-icon-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.delete-sport-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(248, 113, 113, 0.9);
    background: rgba(15, 23, 42, 0.92);
    color: #fecaca;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}
.delete-sport-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.5);
}


/* Hide the skill level edit dropdown by default (though JS handles the display toggle too) */
.sport-level-edit {
    display: none;
}

.is-edit-mode .delete-sport-btn {
    opacity: 1;
    pointer-events: auto;
}

/* Ensure the display text is visible when not in edit mode */
.sport-level-display {
    display: block;
}

.dashboard-header-row {
    display: flex;
    justify-content: space-between; /* Pushes the title and button to opposite ends */
    align-items: center; /* Vertically centers the items */
    margin-bottom: 1rem; /* Add some space below the header */
}
/* Container for the Add Sport link and the Edit Toggle button */
.management-buttons {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between the two buttons */
}

/* Style for the Add Sport link when used in the header */
.header-add-btn {
    /* Uses existing btn-outline-success styles, just ensuring minimal padding */
    padding: 6px 12px;
    font-size: 0.9rem;
    line-height: 1; /* Match vertical alignment */
    text-decoration: none;
    border-radius: 999px;
    height: fit-content;
}


.dashboard-header {
    display: flex;
    align-items: flex-start; /* was: center */
    justify-content: space-between;
    margin-bottom: 18px;
}

.dashboard-greeting {
    margin: 0;
    color: var(--text-primary, #fff);
    font-size: 1.4rem;
    font-weight: 600;
}

/* --- Logout icon button --- */

.logout-icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.15s ease, transform 0.15s ease;
}

    .logout-icon-btn:hover {
        background: rgba(255, 255, 255, 0.18);
        transform: translateY(-1px);
    }

.logout-icon {
    width: 22px;
    height: 22px;
    color: #fff;
}


/* Generic app form wrapper */
.app-form {
    max-width: 420px; /* slightly narrower for nicer proportions */
}

/* Action buttons layout */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    align-items: center;
}

/* Buttons inside actions: no forced full width */
.form-actions .btn-primary,
.form-actions .btn-secondary {
    width: auto; /* override previous 100% */
}

/* Validation summary at top of form */
.validation-summary {
    margin-bottom: 15px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fecaca;
    font-size: 0.85rem;
}

/* Status text variants reusing existing .status-text base */
.status-error {
    color: #fecaca;
}

.status-success {
    color: #bbf7d0;
}

