/* ===================================
   MODERN PROFESSIONAL DESIGN SYSTEM
   =================================== */

/* CSS Variables */
:root {
    /* Dark mode - Professional palette */
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --bg-elevated: #1f1f1f;
    --bg-hover: #2a2a2a;

    --text-primary: #e8e8e8;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --text-muted: #606060;

    --accent-primary: #4a9eff;
    --accent-hover: #6bb0ff;
    --accent-light: #1a3a5a;
    --accent-danger: #ff5555;
    --accent-danger-hover: #ff6b6b;
    --accent-success: #50fa7b;
    --accent-warning: #ffb86c;

    --border-color: #333333;
    --border-light: #2a2a2a;
    --border-focus: #4a9eff;

    /* Modern shadows with subtle depth */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
}

/* ===================================
   RESET & BASE STYLES
   =================================== */

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

html {
    scroll-behavior: smooth;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: 'Shippori Antique', serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern rounded corners */
button,
input,
textarea,
select,
.card,
.prediction-card,
.child-prediction-card,
.auth-form,
.prediction-form,
.message {
    border-radius: 8px;
}

/* No wheel in number input */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
}

/* Subtle rounded corners for smaller elements */
.nav-link,
.logout-btn,
input[type="checkbox"] {
    border-radius: 6px;
}

/* ===================================
   TYPOGRAPHY
   =================================== */

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.875rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
}

small {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* ===================================
   CONTAINER & LAYOUT
   =================================== */

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

header {
    padding: 2rem 0;
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===================================
   PREDICTION CARDS
   =================================== */

.prediction-card {
    position: relative;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;

    .username {
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--accent-primary);
        letter-spacing: 0.01em;
    }

    .text {
        font-size: 1.25em;
        padding: 10px 0;
    }

    .predicted-date {
        font-size: 0.8125rem;
        color: var(--text-tertiary);
    }
}

.predicted {
    color: var(--text-secondary);
    text-decoration: underline;
}

/* ===================================
   SITE HEADER
   =================================== */

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2.5rem;
    background-color: var(--bg-elevated);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.site-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.site-header h1 a {
    color: var(--text-primary);
    text-decoration: none;
}

.header-auth {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#username-display {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

/* ===================================
   NAVIGATION & AUTH
   =================================== */

.auth-status,
.page-nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 32px;
}

.nav-link {
    color: var(--accent-primary);
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: 1px solid var(--accent-primary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}

.logout-btn {
    color: var(--accent-danger);
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: 1px solid var(--accent-danger);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.back-link {
    color: var(--accent-primary);
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* ===================================
   BUTTONS
   =================================== */

button,
.link-button {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    box-shadow: var(--shadow-sm);
    padding: .5em 1em;
}

button:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* ===================================
   FORMS & INPUTS
   =================================== */

.auth-form,
.prediction-form {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
}

select,
textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
}

/* Override width for prediction editor inputs */
#prediction-editor input[type="number"],
#prediction-editor input[type="date"],
#prediction-editor input[type="text"] {
    width: auto;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

input:read-only {
    background-color: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* ===================================
   LISTS & GRIDS
   =================================== */

.predictions-list,
.child-predictions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--text-tertiary);
    font-size: 1rem;
}

/* ===================================
   PREDICTION DETAIL VIEW
   =================================== */

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

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--border-light);
}

#first-prediction {
    display: block;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.prediction {
    position: relative;

    .what {
        font-size: 2.5em;
        margin-bottom: 16px;
    }

    .who,
    .when {
        font-size: .8em;
        line-height: 2;
    }

    .prediction-action-buttons {
        display: flex;
        flex-direction: row;
        margin-top: 16px;

        .prediction-action-button {
            background-color: transparent;
            color: var(--accent-primary);
            margin-right: 16px;
            font-size: .75em;
            padding: 0;
        }
    }

    .three-dot-menu {
        position: relative;
        display: inline-block;
    }

    .three-dot-dropdown {
        position: absolute;
        top: 100%;
        margin-top: 0.5rem;
        background: var(--bg-elevated);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        min-width: 160px;
        display: none;
        z-index: 1000;
        border-radius: 8px;
        overflow: hidden;
    }

    .three-dot-dropdown.show {
        display: block;
    }

    .three-dot-dropdown button {
        width: 100%;
        padding: 0.75rem 1rem;
        background: transparent;
        border: none;
        color: var(--text-primary);
        text-align: left;
        cursor: pointer;
        font-size: 0.875rem;
        border-radius: 0;
    }

    .three-dot-dropdown .delete-button {
        color: var(--accent-danger);
    }
}


.child-predictions {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 2px solid var(--border-light);
}

/* ===================================
   USER PROFILE
   =================================== */

.user-profile-content {
    max-width: 900px;
    margin: 0 auto;
}

.follow-btn {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.follow-btn[data-following="true"] {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.profile-stats-header {
    margin-bottom: 2rem;
}

.follow-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.25rem;
}

.follow-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.follow-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.follow-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 2rem 1.5rem;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ===================================
   MESSAGES & FEEDBACK
   =================================== */

.message {
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
}

.message.error {
    background-color: rgba(220, 53, 69, 0.08);
    border-color: var(--accent-danger);
    color: #c82333;
}

.message.success {
    background-color: rgba(0, 102, 204, 0.08);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.username-feedback {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.username-feedback.available {
    color: var(--accent-success);
}

.username-feedback.taken {
    color: var(--accent-danger);
}

.username-feedback.checking {
    color: var(--text-tertiary);
}

/* ===================================
   ACTIONS & UTILITY
   =================================== */

.actions {
    margin-top: 2rem;
    text-align: center;
}

.username-link,
.child-username {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ===================================
   MOBILE RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .site-header {
        padding: 1rem 1.5rem;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .auth-status {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .auth-form,
    .prediction-form {
        padding: 1.5rem;
    }

    .predictions-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .nav-link,
    .logout-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .follow-stats {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.625rem;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
    flex-shrink: 0;
}

.checkbox-item label {
    cursor: pointer;
    margin: 0;
    color: var(--text-primary);
    font-size: 0.9375rem;
    flex: 1;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.range-inputs input {
    flex: 1;
}

.range-separator {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===================================
   PREDICTION EDITOR
   =================================== */

#prediction-editor {
    padding: 0.875rem;
    background-color: var(--bg-primary);
    border: 2px solid var(--accent-primary);
    min-height: 100px;
    outline: none;
    color: var(--text-primary);
    line-height: 1.6;
    border-radius: 8px;

    input {
        display: inline-block;
        border-radius: 0;
        border: 0px;
        margin: 0 5px;
        padding: 0 5px;
        background-color: var(--bg-primary);
        color: var(--text-secondary);
        font-size: 16px;
        height: 20px;
        field-sizing: content;
        border-bottom: 2px solid var(--text-secondary);
        box-sizing: content-box;
    }

    #prediction-editor-input-date {
        color-scheme: dark;
    }

}

#prediction-editor:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

#prediction-builder-tools {
    margin-top: 0.875rem;
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.builder-tool-button {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===================================
   ACCESSIBILITY
   =================================== */

/* Skip to content link for screen readers */
.skip-to-content {
    position: absolute;
    left: -9999px;
    z-index: 999;
}

.skip-to-content:focus {
    left: 50%;
    margin-left: -50%;
    top: 1rem;
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 8px;
}

#google-sign-in {
    padding-top: 32px;
}