/* ============================================
   eVibes Vibe-Check Platform Stylesheet
   ============================================ */

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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #111827;
    --gray: #6b7280;
    --gray-light: #9ca3af;
    --light-gray: #f3f4f6;
    --border: #e5e7eb;
    --white: #ffffff;
    --bg: #fafafa;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 10px;
    --radius-lg: 14px;
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    color: var(--dark);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--gray); }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; } .mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; } .mb-8 { margin-bottom: 32px; }

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.back-link {
    color: var(--gray);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 16px;
}
.back-link:hover { color: var(--primary); }

/* ===== Navigation ===== */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-content { display: flex; justify-content: space-between; align-items: center; }

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--dark);
    font-size: 1.6rem;
    font-weight: 800;
    gap: 8px;
}
.logo-icon { font-size: 1.8rem; }
.logo-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links { display: flex; list-style: none; gap: 24px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--dark); font-weight: 500; transition: color 0.2s; font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary); }

.btn-nav-primary {
    background: var(--gradient);
    color: var(--white) !important;
    padding: 9px 18px;
    border-radius: var(--radius);
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-nav-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.user-menu { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--gray); font-size: 0.9rem; }
.btn-logout { color: var(--gray-light) !important; font-size: 0.85rem; }
.btn-logout:hover { color: var(--danger) !important; }

.main-content { flex: 1; padding: 32px 0; }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}
.btn-primary {
    background: var(--gradient);
    color: var(--white);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--white); color: var(--dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--light-gray); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: var(--white); }
.btn-large { padding: 14px 28px; font-size: 1.05rem; }
.btn-small { padding: 7px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; display: block; }

/* ===== Forms ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--dark); font-size: 0.95rem; }
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    background: var(--white);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-help { font-size: 0.85rem; color: var(--gray); margin-top: 4px; }
.required-star { color: var(--danger); margin-left: 2px; }

.row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== Card ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.card-divider { margin: 24px 0; border: none; border-top: 1px solid var(--border); }

/* ===== Auth pages ===== */
.auth-container { max-width: 420px; margin: 32px auto; }
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-header h1 { font-size: 2rem; margin-bottom: 6px; }
.auth-header p { color: var(--gray); }
.auth-footer { text-align: center; margin-top: 20px; color: var(--gray); }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }

.error-box {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

/* ===== Flash ===== */
.flash { padding: 12px 0; color: var(--white); font-weight: 500; }
.flash-success { background: var(--success); }
.flash-error { background: var(--danger); }
.flash-info { background: var(--info); }
.flash-warning { background: var(--warning); }

/* ===== Hero ===== */
.hero { text-align: center; padding: 32px 20px 24px; }
.hero h1 { font-size: 3rem; margin-bottom: 12px; line-height: 1.15; }
.hero p { font-size: 1.15rem; color: var(--gray); margin-bottom: 24px; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-feed { padding: 24px 20px; }

/* ===== Feed layout ===== */
.feed-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    margin-top: 16px;
}

.feed-sidebar { position: sticky; top: 90px; align-self: start; }
.sidebar-title { font-size: 0.85rem; text-transform: uppercase; color: var(--gray); margin-bottom: 12px; letter-spacing: 0.5px; }
.category-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.category-link {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s;
    font-size: 0.95rem;
}
.category-link:hover { background: var(--light-gray); }
.category-link.active { background: var(--primary); color: var(--white); }
.cat-emoji { margin-right: 6px; }

.feed-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.feed-header h2 { font-size: 1.5rem; }

.sort-tabs {
    display: flex;
    gap: 4px;
    background: var(--white);
    padding: 4px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.sort-tabs a {
    padding: 6px 14px;
    text-decoration: none;
    color: var(--gray);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}
.sort-tabs a.active { background: var(--primary); color: var(--white); }
.sort-tabs a:not(.active):hover { background: var(--light-gray); color: var(--dark); }

/* ===== Vibe Feed Cards ===== */
.vibe-feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.vibe-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}
.vibe-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.vibe-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.vibe-cat-tag {
    background: var(--light-gray);
    color: var(--dark);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.vibe-cat-tag.header-tag {
    background: rgba(255,255,255,0.25);
    color: var(--white);
    backdrop-filter: blur(8px);
}
.vibe-time { font-size: 0.8rem; color: var(--gray-light); }
.vibe-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; line-height: 1.3; }
.vibe-desc { color: var(--gray); font-size: 0.9rem; flex: 1; }
.vibe-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.vibe-stats { display: flex; flex-direction: column; gap: 2px; font-size: 0.8rem; color: var(--gray); }
.vibe-author { font-style: italic; }
.vibe-score-mini { display: flex; align-items: center; gap: 4px; }
.vibe-score-emoji { font-size: 1.3rem; }
.vibe-score-num { font-weight: 700; color: var(--primary); }

/* ===== Dashboard ===== */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.dashboard-header h1 { font-size: 2rem; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--border); }
.stat-label { color: var(--gray); font-size: 0.85rem; margin-bottom: 6px; }
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--primary); }

/* ===== Survey list (dashboard) ===== */
.survey-list { display: grid; gap: 12px; }
.survey-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    transition: box-shadow 0.2s, transform 0.2s;
}
.survey-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.survey-info h3 { margin-bottom: 4px; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.survey-info p { color: var(--gray); font-size: 0.9rem; margin-bottom: 6px; }
.survey-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.85rem; color: var(--gray); align-items: center; }
.vibe-score-inline { font-weight: 700; color: var(--primary); }
.survey-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 600; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-closed { background: #fee2e2; color: #991b1b; }
.badge-private { background: #e0e7ff; color: #3730a3; }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 48px 20px; background: var(--white); border-radius: var(--radius-lg); border: 2px dashed var(--border); }
.empty-state-icon { font-size: 3.5rem; margin-bottom: 12px; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { color: var(--gray); margin-bottom: 20px; }

/* ===== Create vibe check ===== */
.create-header { text-align: center; margin-bottom: 24px; }
.create-header h1 { font-size: 2.2rem; margin-bottom: 6px; }
.create-header p { color: var(--gray); }

/* ===== Question builder ===== */
.question-builder {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    position: relative;
}
.question-builder-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.question-number {
    background: var(--gradient);
    color: var(--white);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.btn-remove-question {
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 6px;
}
.btn-remove-question:hover { color: var(--danger); background: #fee2e2; }

.option-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.option-row .form-control { flex: 1; }
.btn-remove-option { background: transparent; border: none; color: var(--gray); cursor: pointer; padding: 4px 8px; }
.btn-remove-option:hover { color: var(--danger); }

/* "View Emojis" picker trigger button next to the emoji input */
.btn-emoji-picker {
    background: var(--light-gray);
    border: 1px solid var(--border);
    color: var(--dark);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 1.1rem;
    transition: all 0.15s;
}
.btn-emoji-picker:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* Emoji picker modal */
.emoji-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.emoji-picker-modal[hidden] { display: none; }

.emoji-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.emoji-picker-dialog {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    width: min(640px, 92vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: emojiPickerIn 0.2s ease-out;
}
@keyframes emojiPickerIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.emoji-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
}
.emoji-picker-header h3 { font-size: 1.15rem; margin: 0; }

.emoji-picker-close {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--gray);
    padding: 4px 10px;
    border-radius: 6px;
}
.emoji-picker-close:hover { background: var(--light-gray); color: var(--dark); }

.emoji-picker-search {
    padding: 12px 22px;
    border-bottom: 1px solid var(--border);
}
.emoji-picker-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
.emoji-picker-search input:focus { border-color: var(--primary); }

.emoji-picker-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 22px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}
.emoji-tab {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray);
    white-space: nowrap;
    transition: all 0.15s;
}
.emoji-tab:hover { background: white; color: var(--dark); }
.emoji-tab.active { background: var(--primary); color: white; }

.emoji-picker-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px 22px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 4px;
    align-content: start;
}
.emoji-cell {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    font-size: 1.7rem;
    line-height: 1;
    transition: all 0.1s;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.emoji-cell:hover {
    background: var(--light-gray);
    transform: scale(1.2);
}
.emoji-cell.emoji-picked {
    background: var(--primary);
    transform: scale(1.3);
}

.emoji-no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--gray);
    padding: 32px;
    font-style: italic;
}

.emoji-picker-footer {
    padding: 12px 22px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
    font-size: 0.85rem;
    text-align: center;
}

@media (max-width: 600px) {
    .emoji-picker-dialog {
        width: 96vw;
        max-height: 90vh;
    }
    .emoji-picker-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        padding: 12px;
    }
    .emoji-cell { font-size: 1.5rem; padding: 6px; }
}

.options-container { margin-top: 10px; padding: 14px; background: var(--light-gray); border-radius: var(--radius); }
.required-toggle { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.required-toggle input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

.type-preview {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--light-gray);
    border-radius: var(--radius);
    font-size: 0.85rem;
}
.preview-hint { color: var(--gray); }
.preview-emoji-scale { font-size: 1.2rem; letter-spacing: 4px; }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* ===== Vibe-taking page ===== */
.survey-take { max-width: 700px; margin: 0 auto; }
.survey-take-header {
    background: var(--gradient);
    color: var(--white);
    padding: 36px 32px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    text-align: center;
}
.survey-take-header h1 { font-size: 1.8rem; margin-bottom: 8px; line-height: 1.3; }
.survey-take-header p { opacity: 0.95; }
.survey-take-header .header-tag { display: inline-block; margin-bottom: 12px; }

.survey-meta-bar {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 14px;
    font-size: 0.85rem;
    opacity: 0.85;
    flex-wrap: wrap;
}

.survey-take-body {
    background: var(--white);
    padding: 32px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border: 1px solid var(--border);
    border-top: none;
}
.question-block { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.question-block:last-of-type { border-bottom: none; padding-bottom: 0; }
.question-text { font-size: 1.1rem; font-weight: 700; margin-bottom: 14px; }

/* Radio & checkbox options */
.radio-option, .checkbox-option {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.radio-option:hover, .checkbox-option:hover { border-color: var(--primary); background: rgba(99,102,241,0.04); }
.radio-option input, .checkbox-option input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }

/* Star rating */
.rating-stars { display: flex; gap: 8px; font-size: 2.4rem; }
.rating-stars label { cursor: pointer; }
.rating-stars input { display: none; }
.star-display { color: var(--border); transition: color 0.2s; cursor: pointer; }
.star-display.active { color: var(--warning); }

/* Yes / No */
.yesno-options { display: flex; gap: 10px; }
.yesno-options label {
    flex: 1; padding: 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 1.05rem;
}
.yesno-options input { display: none; }
.yesno-options input:checked + label, .yesno-options label.selected { border-color: var(--primary); background: var(--gradient); color: var(--white); }

/* Thumbs up/down */
.thumbs-options label { padding: 24px 18px; }
.thumbs-options .thumb-big { font-size: 3rem; line-height: 1; display: block; }
.thumbs-options input:checked + label .thumb-big,
.thumbs-options label.selected .thumb-big { transform: scale(1.1); transition: transform 0.15s; }

/* Emoji scale / fire meter */
.emoji-scale-input {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.emoji-scale-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.emoji-scale-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    background: rgba(99,102,241,0.04);
}
.emoji-scale-btn.selected {
    border-color: var(--primary);
    background: rgba(99,102,241,0.1);
    transform: scale(1.05);
}
.emoji-big { font-size: 2rem; line-height: 1; }
.emoji-label { font-size: 0.75rem; color: var(--gray); font-weight: 600; }
.fire-meter .emoji-big { font-size: 1.3rem; letter-spacing: -2px; }

/* Emoji reactions (custom set) */
.emoji-reaction-input {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.emoji-reaction-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 18px;
    min-width: 90px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.emoji-reaction-btn:hover { border-color: var(--primary); transform: translateY(-2px); }
.emoji-reaction-btn.selected { border-color: var(--primary); background: rgba(99,102,241,0.1); transform: scale(1.05); }

/* ===== Thank-you screen ===== */
.thank-you-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 60px 32px;
    text-align: center;
    max-width: 500px;
    margin: 32px auto;
    border: 1px solid var(--border);
}
.thank-you-icon { font-size: 5rem; margin-bottom: 12px; }
.thank-you-card h1 { font-size: 2rem; margin-bottom: 8px; }
.thank-you-card p { color: var(--gray); margin-bottom: 24px; }
.thank-you-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ===== Share page ===== */
.share-container { max-width: 640px; margin: 0 auto; text-align: center; }
.share-container h1 { font-size: 2rem; margin-bottom: 4px; }
.qr-container {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: inline-block;
    margin: 20px 0;
}
.qr-container img { display: block; max-width: 280px; }
.qr-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.print-hint { font-size: 0.85rem; margin-top: 6px; }
.share-link-box {
    background: var(--light-gray);
    padding: 14px;
    border-radius: var(--radius);
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.share-link-box input { flex: 1; background: transparent; border: none; font-size: 0.9rem; color: var(--dark); outline: none; font-family: monospace; }

.social-share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.social-btn { padding: 12px; text-align: center; border-radius: var(--radius); color: var(--white); text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: opacity 0.2s; }
.social-btn:hover { opacity: 0.9; }
.social-x { background: #000; }
.social-fb { background: #1877f2; }
.social-wa { background: #25d366; }
.social-em { background: var(--gray); }

.share-actions-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tip-list { text-align: left; color: var(--gray); padding-left: 20px; line-height: 1.9; }
.tip-list li { margin-bottom: 4px; }

/* ===== Embed code section on share page ===== */
.embed-preview-wrap {
    margin: 16px 0 20px;
}
.embed-section-h {
    font-size: 1rem;
    margin-top: 18px;
    margin-bottom: 4px;
    color: var(--dark);
}
.embed-code-box {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin: 8px 0 4px;
}
.embed-code-box textarea {
    flex: 1;
    min-height: 70px;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    background: var(--light-gray);
    color: var(--dark);
    resize: vertical;
    outline: none;
}
.embed-code-box textarea:focus { border-color: var(--primary); }
.embed-code-box .btn { align-self: flex-start; white-space: nowrap; }

.embed-advanced {
    margin-top: 16px;
    padding: 12px;
    background: var(--light-gray);
    border-radius: var(--radius);
}
.embed-advanced summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--dark);
}
.embed-advanced[open] summary { margin-bottom: 8px; }
.embed-advanced code {
    background: rgba(99,102,241,0.1);
    color: var(--primary);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.85em;
}
.embed-supported {
    margin-top: 16px;
    padding: 10px 12px;
    background: rgba(99,102,241,0.05);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    font-size: 0.85rem;
}

/* ===== Results page ===== */
.results-back { margin-bottom: 16px; }
.results-hero {
    background: var(--gradient);
    color: var(--white);
    padding: 36px 32px;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 16px;
}
.results-hero h1 { font-size: 1.9rem; margin: 8px 0; line-height: 1.25; }
.results-author { opacity: 0.85; font-size: 0.9rem; margin-bottom: 16px; }

.vibe-score-big {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: var(--radius-lg);
    display: inline-block;
    margin: 8px 0;
}
.vibe-score-emoji-big { font-size: 3.5rem; line-height: 1; }
.vibe-score-number { font-size: 2.4rem; font-weight: 800; margin: 4px 0; }
.vibe-score-label { font-size: 1rem; opacity: 0.95; text-transform: uppercase; letter-spacing: 1px; }

.results-stats-row { display: flex; justify-content: center; gap: 28px; margin-top: 16px; flex-wrap: wrap; }
.stat-mini { text-align: center; }
.stat-mini-value { font-size: 1.4rem; font-weight: 800; }
.stat-mini-label { font-size: 0.75rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.5px; }

.results-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }

.results-grid { display: grid; gap: 18px; }
.result-question {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 22px;
    border: 1px solid var(--border);
}
.result-question-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.result-question h3 { font-size: 1.05rem; flex: 1; min-width: 200px; }
.result-avg { color: var(--gray); margin-bottom: 8px; font-size: 0.95rem; }

.chart-container { position: relative; height: 280px; margin: 12px 0; }
.chart-container-small { height: 180px; }

/* When Bubbles mode is on for a question, collapse the chart container (no canvas chart
   is shown) and hide the data table/average. The emojis appear on a full-viewport overlay
   that's not bound to this card. */
.result-question.bubbles-mode .chart-container {
    height: 0;
    margin: 0;
    overflow: hidden;
}
.result-question.bubbles-mode .result-table-wrap { display: none; }
.result-question.bubbles-mode .result-avg { display: none; }

/* "Now floating across the whole page" hint, shown in place of the chart when Bubbles is on */
.result-question.bubbles-mode::after {
    content: "🫧 Emojis are drifting across the whole page — switch to Bar/Pie/Doughnut to see the numbers.";
    display: block;
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
    padding: 24px 12px;
    background: linear-gradient(180deg, rgba(99,102,241,0.05), rgba(236,72,153,0.05));
    border-radius: var(--radius);
    margin-top: 12px;
}

/* Full-viewport overlay that holds drifting emojis */
#driftEmojiOverlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;          /* behind page content */
}
.drift-emoji {
    position: absolute;
    bottom: -10vh;
    user-select: none;
    pointer-events: none;
    line-height: 1;
    text-shadow: 0 2px 12px rgba(0,0,0,0.18);
    animation: driftRise var(--duration, 9s) linear forwards;
    will-change: transform, opacity;
}
@keyframes driftRise {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    8%   { opacity: var(--max-opacity, 0.85); }
    50%  { transform: translate(calc(var(--drift-x, 0vw) * 0.5), -55vh) rotate(calc(var(--rotate, 180deg) * 0.5)); }
    92%  { opacity: var(--max-opacity, 0.85); }
    100% { transform: translate(var(--drift-x, 0vw), -120vh) rotate(var(--rotate, 360deg)); opacity: 0; }
}

/* New-vote celebration: extra glow ring on the emoji.
   We avoid animating transform here because driftRise already owns transform —
   instead we animate filter (drop-shadow ring) which won't conflict. */
.drift-emoji-new {
    animation: driftRise var(--duration, 9s) linear forwards,
               newVoteFlash 3s ease-out forwards;
    z-index: 5;
}
@keyframes newVoteFlash {
    0%   { filter: drop-shadow(0 0 0   rgba(255,255,255,0)); }
    10%  { filter: drop-shadow(0 0 50px rgba(255,255,255,1))
                  drop-shadow(0 0 25px rgba(99,102,241,1)); }
    30%  { filter: drop-shadow(0 0 45px rgba(236,72,153,0.95))
                  drop-shadow(0 0 20px rgba(255,255,255,0.85)); }
    55%  { filter: drop-shadow(0 0 35px rgba(99,102,241,0.85))
                  drop-shadow(0 0 18px rgba(236,72,153,0.6)); }
    80%  { filter: drop-shadow(0 0 20px rgba(99,102,241,0.5)); }
    100% { filter: drop-shadow(0 0 0   rgba(99,102,241,0)); }
}

/* Keep page content above the overlay so it's still clickable */
.main-content, .navbar, .footer { position: relative; z-index: 2; }

@media (prefers-reduced-motion: reduce) {
    .drift-emoji { animation: none; opacity: 0; }
}

/* ===== Kiosk / TV mode =====
   Activated via ?fullscreen=1 on the results page. Hides ALL page chrome and
   content so the only thing visible on a TV is the floating emoji overlay. */
body.kiosk-mode {
    background: #0a0a0f;            /* dark backdrop for big-screen contrast */
    overflow: hidden;
}
body.kiosk-mode .navbar,
body.kiosk-mode .footer,
body.kiosk-mode .flash,
body.kiosk-mode .main-content > .container > * {
    display: none !important;
}
body.kiosk-mode .main-content {
    padding: 0;
    height: 100vh;
    width: 100vw;
    z-index: auto;     /* don't create a stacking context that traps fixed children */
}
body.kiosk-mode #driftEmojiOverlay {
    z-index: 10;                     /* now on top — nothing else to compete with */
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a0f 100%);
}
/* Make emojis even bigger on the TV */
body.kiosk-mode .drift-emoji {
    text-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

/* Optional small "press F to exit" hint at the bottom-right, fades out after a few seconds */
body.kiosk-mode::after {
    content: "Press ESC or close tab to exit • Updating every 3 seconds";
    position: fixed;
    bottom: 16px;
    right: 24px;
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 20;
    pointer-events: none;
    animation: kioskHintFade 6s ease-out forwards;
}
@keyframes kioskHintFade {
    0%   { opacity: 0; }
    10%  { opacity: 0.8; }
    80%  { opacity: 0.8; }
    100% { opacity: 0; }
}

/* Kiosk QR card — only visible in kiosk mode, anchored bottom-left for TV display */
.kiosk-qr-card { display: none; }
body.kiosk-mode .kiosk-qr-card {
    display: block;
    position: fixed;
    bottom: 32px;
    left: 32px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 22px 24px 20px;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    max-width: 340px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.kiosk-qr-category {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kiosk-qr-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
    margin-bottom: 14px;
    max-width: 280px;
    /* Clamp to 2 lines so very long titles don't push the QR off-screen */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.kiosk-qr-cta {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}
.kiosk-qr-image {
    background: white;
    padding: 8px;
    border-radius: 12px;
    display: inline-block;
    line-height: 0;
}
.kiosk-qr-image img {
    display: block;
    width: 220px;
    height: 220px;
}
.kiosk-qr-counter {
    margin-top: 12px;
    font-size: 0.95rem;
    color: var(--gray);
    font-weight: 600;
}
.kiosk-qr-counter span {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.15rem;
    display: inline-block;
}

/* Pulse animation when the vote counter increments */
.kiosk-counter-pulse span {
    animation: kioskCountPulse 0.6s ease-out;
}
@keyframes kioskCountPulse {
    0%   { transform: scale(1);   color: var(--primary); }
    40%  { transform: scale(1.4); color: var(--secondary); }
    100% { transform: scale(1);   color: var(--primary); }
}

/* On very small kiosk screens (rare) shrink the card a bit */
@media (max-width: 600px) {
    body.kiosk-mode .kiosk-qr-card {
        bottom: 16px;
        left: 16px;
        padding: 14px 16px 14px;
        max-width: 220px;
    }
    body.kiosk-mode .kiosk-qr-image img {
        width: 160px;
        height: 160px;
    }
    body.kiosk-mode .kiosk-qr-title {
        font-size: 0.95rem;
    }
}

/* ===== Portrait kiosk mode =====
   Triggered two ways: (1) the body has class .kiosk-portrait (from ?portrait=1 in URL),
   or (2) the browser viewport is naturally taller than it is wide (auto-detect).
   The :where() trick scopes the auto-detect rules without bumping specificity. */
body.kiosk-portrait .kiosk-qr-card,
body.kiosk-mode:where(:not(.kiosk-portrait)) .kiosk-qr-card {
    /* shared portrait-card baseline */
}

/* === Forced portrait (URL flag) === */
body.kiosk-portrait .kiosk-qr-card {
    /* In portrait the bottom-left card competes with the rising emojis.
       Move it to the top center where it stays out of the emoji flow. */
    bottom: auto;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 480px;
    text-align: center;
    padding: 26px 28px 24px;
}
body.kiosk-portrait .kiosk-qr-image img {
    width: 280px;
    height: 280px;
}
body.kiosk-portrait .kiosk-qr-title {
    font-size: 1.4rem;
    max-width: 100%;
    -webkit-line-clamp: 3;
}
body.kiosk-portrait .kiosk-qr-cta {
    font-size: 1.1rem;
}
body.kiosk-portrait .kiosk-qr-counter {
    font-size: 1.1rem;
}
/* Move the exit hint to bottom-center in portrait (no QR card competing there) */
body.kiosk-portrait::after {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

/* === Auto-detected portrait (no URL flag — browser reports portrait dimensions) === */
@media (orientation: portrait) {
    body.kiosk-mode:not(.kiosk-portrait) .kiosk-qr-card {
        bottom: auto;
        top: 32px;
        left: 50%;
        transform: translateX(-50%);
        max-width: 480px;
        text-align: center;
        padding: 26px 28px 24px;
    }
    body.kiosk-mode:not(.kiosk-portrait) .kiosk-qr-image img {
        width: 280px;
        height: 280px;
    }
    body.kiosk-mode:not(.kiosk-portrait) .kiosk-qr-title {
        font-size: 1.4rem;
        max-width: 100%;
        -webkit-line-clamp: 3;
    }
    body.kiosk-mode:not(.kiosk-portrait)::after {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

.chart-type-toggle { display: flex; gap: 3px; background: var(--light-gray); padding: 3px; border-radius: var(--radius); flex-wrap: wrap; }
.chart-type-toggle button { background: transparent; border: none; padding: 5px 11px; cursor: pointer; border-radius: 6px; font-size: 0.8rem; font-weight: 600; color: var(--gray); }
.chart-type-toggle button.active { background: var(--white); color: var(--dark); box-shadow: var(--shadow-sm); }

.result-table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 0.9rem; }
.result-table th { background: var(--light-gray); padding: 8px 12px; text-align: left; font-weight: 600; font-size: 0.85rem; color: var(--gray); text-transform: uppercase; }
.result-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.result-table tr:last-child td { border-bottom: none; }

.bar-mini { position: relative; height: 22px; background: var(--light-gray); border-radius: 4px; min-width: 100px; }
.bar-mini-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--gradient); border-radius: 4px; transition: width 0.4s; }
.bar-mini span { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 0.75rem; font-weight: 600; color: var(--dark); z-index: 1; }

.text-responses { max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.text-response-item { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.text-response-item:last-child { border-bottom: none; }
.no-responses { text-align: center; padding: 20px; color: var(--gray); font-style: italic; font-size: 0.9rem; }

/* ===== Footer ===== */
.footer { background: var(--white); border-top: 1px solid var(--border); padding: 24px 0; text-align: center; color: var(--gray); font-size: 0.85rem; margin-top: auto; }
.footer-links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.footer-links a { color: var(--gray); text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--primary); }

/* ===== Static pages (About, How It Works) ===== */
.static-page { max-width: 820px; margin: 0 auto; }
.static-hero { text-align: center; padding: 16px 20px 32px; }
.static-hero h1 { font-size: 2.6rem; margin-bottom: 8px; line-height: 1.15; }
.static-lead { font-size: 1.2rem; color: var(--gray); }

.static-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
}
.static-card h2 {
    font-size: 1.6rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.static-card h3 {
    font-size: 1.15rem;
    margin: 18px 0 10px;
    color: var(--dark);
}
.static-card h4 { font-size: 1rem; margin: 14px 0 8px; color: var(--primary); }
.static-card p { margin-bottom: 12px; color: var(--dark); }
.static-card p:last-child { margin-bottom: 0; }
.static-card code {
    background: var(--light-gray);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}
.step-emoji { font-size: 1.2rem; }

.static-list { padding-left: 22px; margin-bottom: 12px; line-height: 1.9; }
.static-list li { margin-bottom: 4px; }

.static-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.static-cat {
    background: var(--light-gray);
    padding: 18px;
    border-radius: var(--radius);
    text-align: center;
}
.static-cat-emoji { font-size: 2rem; margin-bottom: 6px; }
.static-cat h3 { margin: 4px 0; font-size: 1.05rem; }
.static-cat p { font-size: 0.88rem; color: var(--gray); margin: 0; }

.step-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.step-card {
    background: var(--light-gray);
    padding: 22px 18px;
    border-radius: var(--radius);
    text-align: center;
    position: relative;
}
.step-num {
    background: var(--gradient);
    color: var(--white);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    margin: 0 auto 10px;
}
.step-card h3 { margin: 4px 0 6px; font-size: 1.05rem; }
.step-card p { font-size: 0.88rem; color: var(--gray); margin: 0; }

.qtype-section { margin: 16px 0; }
.qtype-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 0.93rem; }
.qtype-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.qtype-table tr:last-child td { border-bottom: none; }
.qtype-icon { font-size: 1.4rem; width: 80px; text-align: center; white-space: nowrap; }

.tip-box {
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(236,72,153,0.08));
    border-left: 4px solid var(--primary);
    padding: 14px 18px;
    border-radius: var(--radius);
    margin: 16px 0 4px;
    font-size: 0.95rem;
}

.social-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 12px 0;
}
.social-info {
    background: var(--light-gray);
    padding: 16px;
    border-radius: var(--radius);
}
.social-info-icon {
    font-size: 1.6rem;
    font-weight: 800;
    width: 38px;
    height: 38px;
    background: var(--white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}
.social-info h4 { margin: 0 0 4px; color: var(--dark); }
.social-info p { font-size: 0.88rem; color: var(--gray); margin: 0; }

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    padding: 4px 0;
    color: var(--dark);
    list-style: none;
    position: relative;
    padding-right: 24px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    color: var(--primary);
    font-weight: 400;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { color: var(--primary); }
.faq-item p {
    margin-top: 10px;
    color: var(--gray);
    font-size: 0.95rem;
}

.static-cta {
    background: var(--gradient);
    color: var(--white);
    text-align: center;
}
.static-cta h2 { justify-content: center; }
.static-cta p { color: rgba(255,255,255,0.95); }
.static-cta-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 18px;
}
.static-cta .btn-primary {
    background: var(--white);
    color: var(--primary);
}
.static-cta .btn-secondary {
    background: rgba(255,255,255,0.15);
    color: var(--white);
    border-color: rgba(255,255,255,0.4);
    backdrop-filter: blur(8px);
}
.static-cta .btn-secondary:hover { background: rgba(255,255,255,0.25); }

@media (max-width: 600px) {
    .static-hero h1 { font-size: 2rem; }
    .static-lead { font-size: 1rem; }
    .static-card { padding: 22px; }
    .qtype-icon { width: 60px; font-size: 1.2rem; }
}

/* ===== Toast ===== */
.copy-success {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    animation: slideDown 0.3s ease-out;
    font-weight: 600;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .feed-layout { grid-template-columns: 1fr; }
    .feed-sidebar { position: static; }
    .category-list { display: flex; flex-wrap: wrap; gap: 6px; }
    .category-link { padding: 6px 12px; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; }
    .nav-links { gap: 12px; font-size: 0.9rem; }
    .user-name { display: none; }
    .survey-item { flex-direction: column; align-items: flex-start; }
    .survey-take-header, .survey-take-body { padding: 22px; }
    .card { padding: 20px; }
    .row-2col { grid-template-columns: 1fr; }
    .emoji-big { font-size: 1.6rem; }
    .results-hero h1 { font-size: 1.5rem; }
    .vibe-score-emoji-big { font-size: 3rem; }
    .vibe-score-number { font-size: 2rem; }
    .vibe-feed { grid-template-columns: 1fr; }
}
