/* ===================================
   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: #923e92;
    --accent-hover: #6bb0ff;
    --accent-light: #1a3a5a;
    --accent-danger: #c235a6;
    --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: 1.5rem;
    min-height: 100vh;
}

header {
    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;

    .visibility {
        font-size: 0.75em;
        color: var(--text-secondary);
    }

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

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

        :hover {
            text-decoration: underline;
        }
    }

    .predicted-date {
        font-size: 0.75em;
        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;
    background-color: var(--bg-elevated);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 16px 32px;
}

.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
   =================================== */

#blurb {
    max-width: 600px;
    margin: auto;
    text-align: center;
}

.auth-status,
.page-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding-bottom: 1.5rem;

    #predict-link {
        border-radius: 5px;
        padding: 8px 16px;
        background-color: var(--bg-tertiary);
        text-align: center;
        vertical-align: middle;
    }

    #search-link {
        margin-left: auto;
        font-size: 1.5em;
        cursor: pointer;
    }
}

.search-container {
    padding-bottom: 1.5rem;
}

.nav-link {
    color: var(--accent-primary);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0;
}

.selected {
    border-bottom: 2px solid var(--accent-primary);
}

.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: 32px auto;

    #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;
    }

    #visibility-container {
        select {
            width: auto;
        }
    }
}

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

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

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;
    max-width: 1000px;
    margin: auto;

    .content {
        padding: 3rem;
        padding-bottom: 1rem;
        background-color: var(--bg-elevated);
        border-radius: 10px;
        margin-bottom: 16px;

        .what {
            font-size: 2rem;
        }
    }

    .who {
        font-size: 2rem;
        line-height: 2;
        text-align: center;
        margin-bottom: 16px;
    }
    .post {
        display: flex;
        flex-direction: row;
        align-items: center;
        .metadata {
            flex: 1;
        }
        .truth {
            display: flex;
            gap: 1rem;
            button {
                background-color: transparent;
                color: var(--accent-primary);
                font-size: .75em;
                padding: 0;
            }
        }
    }
    .subtext {
        font-size: .8rem;
        line-height: 2;
    }

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

        #heart-container {
            display: flex;
            flex-direction: column;
            gap: 5%;
            #num-likes {
                width: 24px;
                color: var(--accent-primary);
                text-align: center;
                font-size: .75rem;
            }
        }

        .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);
        display: none;
        z-index: 1000;
        border-radius: 8px;
        overflow: hidden;
    }

    .three-dot-dropdown.show {
        display: flex;
        flex-direction: column;
    }

    .three-dot-dropdown button {
        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);
    }
    .material-symbols-outlined {
        font-variation-settings: 'FILL' 0;

    }

    .material-symbols-outlined.filled {
        font-variation-settings: 'FILL' 1;
    }
}


.child-predictions {
    h2 {
        text-align: center;
    }
    max-width: 1000px;
    margin: auto;
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 2px solid var(--border-light);
}

/* ===================================
   USER PROFILE
   =================================== */
#profile-header {
    display: flex;
    flex-direction: row;
    gap: 1.25em;
    margin-bottom: 2rem;
    align-items: flex-end;

    #profile-username {
        margin: 0;
    }
}

#stats {
    margin-bottom: 2rem;
}

.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;
}

/* ===================================
   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) {
    .site-header {
        padding: 1rem 1.5rem;

        h1 {
            padding-bottom: 1.5rem;
        }
    }

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

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

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

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

    .prediction .post {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

.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;
}

/* Tooltip styling */
.tooltip-message {
    position: absolute;
    background-color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1000;
    white-space: nowrap;
}

.tooltip-message.tooltip-above {
    bottom: calc(-250% + 12px);
    left: -6px;
}

.tooltip-message span {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.tooltip-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tooltip-close:hover {
    color: var(--text-primary);
}

.tooltip-arrow {
    position: absolute;
    bottom: 41px;
    left: 12px;
    width: 12px;
    height: 12px;
    background-color: var(--text-muted);
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.prediction-action-buttons {
    position: relative;
}

/* ===================================
   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;
}