/* Qoleq - Shared Styles */

/* Theme Color Variables */
:root {
    --theme-primary: #047857;
    --theme-primary-hover: #065f46;
    --theme-gradient-start: #064e3b;
    --theme-gradient-end: #10b981;
    /* ===== BACKGROUND SYSTEM ===== */
    /* Three-tier hierarchy for photo-first design */
    --bg-page: #fafdfb; /* 2-3% green tint - soft, airy page background */
    --bg-surface: #ffffff; /* Pure white for cards/photos - maximum contrast */
    --bg-accent: #f0f9f6; /* 8-10% green tint - subtle section dividers */
    --bg-hover: #e6f7f1; /* 12-15% green tint - interactive hover states */
}

/* Theme Color Overrides */
[data-theme="green"] {
    --theme-primary: #047857; /* deep emerald */
    --theme-primary-hover: #065f46;
    --theme-gradient-start: #064e3b;
    --theme-gradient-end: #10b981;
    /* Green theme backgrounds */
    --bg-page: #fafdfb; /* Very light mint-green tint */
    --bg-surface: #ffffff;
    --bg-accent: #f0f9f6; /* Subtle green wash */
    --bg-hover: #e6f7f1;
}

[data-theme="blue"] {
    --theme-primary: #2563eb;
    --theme-primary-hover: #1d4ed8;
    --theme-gradient-start: #1e3c72;
    --theme-gradient-end: #2a5298;
    /* Blue theme backgrounds */
    --bg-page: #fafcfe; /* Very light sky-blue tint */
    --bg-surface: #ffffff;
    --bg-accent: #eff6ff; /* Subtle blue wash */
    --bg-hover: #dbeafe;
}

[data-theme="pink"] {
    --theme-primary: #ec4899;
    --theme-primary-hover: #db2777;
    --theme-gradient-start: #c471f5;
    --theme-gradient-end: #fa71cd;
    /* Pink theme backgrounds */
    --bg-page: #fefafc; /* Very light blush tint */
    --bg-surface: #ffffff;
    --bg-accent: #fdf2f8; /* Subtle pink wash */
    --bg-hover: #fce7f3;
}

[data-theme="purple"] {
    --theme-primary: #6366f1;
    --theme-primary-hover: #4f46e5;
    --theme-gradient-start: #5f2c82;
    --theme-gradient-end: #49a09d;
    /* Purple theme backgrounds */
    --bg-page: #fafaff; /* Very light lavender tint */
    --bg-surface: #ffffff;
    --bg-accent: #f5f3ff; /* Subtle purple wash */
    --bg-hover: #ede9fe;
}

[data-theme="black"] {
    --theme-primary: #1f2937;
    --theme-primary-hover: #111827;
    --theme-gradient-start: #111827;
    --theme-gradient-end: #374151;
    /* Black/Gray theme backgrounds */
    --bg-page: #fafafa; /* Very light warm gray */
    --bg-surface: #ffffff;
    --bg-accent: #f5f5f5; /* Subtle gray wash */
    --bg-hover: #e5e5e5;
}

[data-theme="red"] {
    --theme-primary: #e11d48;
    --theme-primary-hover: #be123c;
    --theme-gradient-start: #e11d48;
    --theme-gradient-end: #f43f5e;
    /* Red theme backgrounds */
    --bg-page: #fffafa; /* Very light rose tint */
    --bg-surface: #ffffff;
    --bg-accent: #fef2f2; /* Subtle red wash */
    --bg-hover: #fee2e2;
}

/* Standard/Premium-only themes */
[data-theme="champagne-gold"] {
    --theme-primary: #C9A96E;
    --theme-primary-hover: #b8985e;
    --theme-gradient-start: #b8985e;
    --theme-gradient-end: #d4bc8a;
    --bg-page: #fdfbf7;
    --bg-surface: #ffffff;
    --bg-accent: #faf6ef;
    --bg-hover: #f5eedf;
}

[data-theme="blush-rose"] {
    --theme-primary: #d4b8ad;
    --theme-primary-hover: #c4a49a;
    --theme-gradient-start: #e8cec8;
    --theme-gradient-end: #f2e0d9;
    --bg-page: #fdf8f7;
    --bg-surface: #ffffff;
    --bg-accent: #fdf2f0;
    --bg-hover: #fae8e4;
}

[data-theme="dusty-mauve"] {
    --theme-primary: #b09090;
    --theme-primary-hover: #a08080;
    --theme-gradient-start: #c4a4a4;
    --theme-gradient-end: #d4b8b8;
    --bg-page: #faf7f7;
    --bg-surface: #ffffff;
    --bg-accent: #f5f0f0;
    --bg-hover: #efe8e8;
}

[data-theme="ivory-cream"] {
    --theme-primary: #d4c4a0;
    --theme-primary-hover: #c4b490;
    --theme-gradient-start: #e8dcc4;
    --theme-gradient-end: #faf3e0;
    --bg-page: #fdfbf5;
    --bg-surface: #ffffff;
    --bg-accent: #faf7f0;
    --bg-hover: #f5f0e5;
}

[data-theme="deep-burgundy"] {
    --theme-primary: #5C1A2E;
    --theme-primary-hover: #4a1525;
    --theme-gradient-start: #5C1A2E;
    --theme-gradient-end: #7a2a40;
    --bg-page: #fdf5f7;
    --bg-surface: #ffffff;
    --bg-accent: #fae8ec;
    --bg-hover: #f5d8de;
}

[data-theme="sage-mist"] {
    --theme-primary: #8a9d85;
    --theme-primary-hover: #7a8d75;
    --theme-gradient-start: #b8c9b0;
    --theme-gradient-end: #d4dece;
    --bg-page: #f7f9f6;
    --bg-surface: #ffffff;
    --bg-accent: #eef2ec;
    --bg-hover: #e4ebe0;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    color: #1c1e21;
    background: var(--bg-page); /* ← Now uses theme-aware background */
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-h);
}

/* Typography */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #050505;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #050505;
    margin-bottom: 0.75rem;
}

p {
    font-size: 1rem;
    color: #65676b;
    margin-bottom: 0.75rem;
}

/* Container */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Cards */
.card {
    background: var(--bg-surface); /* ← Pure white for photo cards */
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-compact {
    padding: 1rem;
}

/* Optional: Accent card variant for non-photo sections */
.card-accent {
    background: var(--bg-accent); /* ← Subtle tinted background */
    border-radius: 8px;
    box-shadow: none;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--theme-primary);
    color: white;
}

    .btn-primary:hover {
        background: var(--theme-primary-hover);
    }

    .btn-primary:disabled {
        background: #e4e6eb;
        color: #bcc0c4;
        cursor: not-allowed;
    }

.btn-secondary {
    background: var(--bg-accent); /* ← Use accent background for secondary buttons */
    color: #050505;
}

    .btn-secondary:hover {
        background: var(--bg-hover); /* ← Hover state with more tint */
    }

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #050505;
    margin-bottom: 0.5rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--bg-surface); /* ← White background for inputs */
}

    .form-input:focus,
    .form-textarea:focus {
        outline: none;
        border-color: var(--theme-primary);
        box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.1);
    }

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.8125rem;
    color: #65676b;
    margin-top: 0.25rem;
}

.form-required {
    color: #d93025;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    background: var(--bg-accent); /* ← Theme-tinted badge background */
    color: var(--theme-primary);
}

/* Base message */
.message {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    margin-bottom: 1rem;
    background: var(--message-bg);
    color: var(--message-text);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    border-left: 4px solid var(--message-accent);
}

.message-success {
    --message-bg: rgba(16, 185, 129, 0.12); /* soft green tint */
    --message-text: #065f46;
    --message-accent: #10b981;
}

.message-error {
    --message-bg: rgba(239, 68, 68, 0.12); /* soft red tint */
    --message-text: #7f1d1d;
    --message-accent: #ef4444;
}

.message-info {
    --message-bg: rgba(59, 130, 246, 0.12); /* soft blue tint */
    --message-text: #1e3a8a;
    --message-accent: #3b82f6;
}


/* Header (for event pages) */
.header {
    background: linear-gradient(135deg, var(--theme-gradient-start), var(--theme-gradient-end));
    border-bottom: 1px solid #dadde1;
    padding: 1rem;
    position: fixed !important;
    top: 0;
    z-index: 100;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.1);
    left: 0;
    right: 0;
}

.header-content {
    max-width: 680px;
    margin: 0 auto;
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.header p {
    font-size: 0.9375rem;
    margin-bottom: 0;
}

.event-date {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0.5rem;
    opacity: 0.9;
    animation: slideDown 0.6s ease-out 0.2s backwards;
}

.event-date-icon {
    font-size: 1rem;
}


/* ===== Collapsing header on scroll ===== */
.header.is-collapsed {
    padding: 0 0 0 0.5rem !important; /* remove top/bottom padding */
    min-height: auto !important; /* allow shrinking */
}

/* Hide description smoothly */
#eventDescription, .event-badge, .event-date {
    transition: opacity 0.25s ease, max-height 0.25s ease, margin 0.25s ease;
}

.header.is-collapsed #eventDescription {
    opacity: 0;
    max-height: 0;
    margin: 0;
    overflow: hidden;
}

/* Optional: hide badge when collapsed */
.header.is-collapsed .event-badge {
    opacity: 0;
    max-height: 0;
    margin: 0;
    overflow: hidden;
}

.header.is-collapsed .event-date {
    opacity: 0;
    max-height: 0;
    margin: 0;
    overflow: hidden;
}

/* Slightly compact title when collapsed */
.header.is-collapsed h1 {
    font-size: 1.25rem;
}

/* Prevent content jump */
.event-badge {
    transition: opacity 0.25s ease, max-height 0.25s ease, margin 0.25s ease;
}

.event-date {
    transition: opacity 0.25s ease, max-height 0.25s ease, margin 0.25s ease;
}

#headerSpacer {
    transition: height 0.25s ease;
}

/* Shrink spacer when header collapses */
.header.is-collapsed + #headerSpacer {
    height: 64px;
}

/* Theme-colored header */
.header.themed {
    background: linear-gradient(135deg, var(--theme-gradient-start), var(--theme-gradient-end));
    color: white;
    border-bottom: none;
}

    .header.themed h1,
    .header.themed p {
        color: white;
    }

/* Black theme - ensure white text */
[data-theme="black"] .header.themed h1,
[data-theme="black"] .header.themed p,
[data-theme="deep-burgundy"] .header.themed h1,
[data-theme="deep-burgundy"] .header.themed p {
    color: white;
}

/* Premium themes - header/avatar/button text: white on dark, dark on light (match Create page badges) */
[data-theme="champagne-gold"] .header.themed h1,
[data-theme="champagne-gold"] .header.themed p,
[data-theme="dusty-mauve"] .header.themed h1,
[data-theme="dusty-mauve"] .header.themed p {
    color: #fff;
}

[data-theme="blush-rose"] .header.themed h1,
[data-theme="blush-rose"] .header.themed p,
[data-theme="blush-rose"] .header.themed .event-badge {
    color: #5c4a45;
}

[data-theme="ivory-cream"] .header.themed h1,
[data-theme="ivory-cream"] .header.themed p,
[data-theme="ivory-cream"] .header.themed .event-badge {
    color: #5c5348;
}

[data-theme="sage-mist"] .header.themed h1,
[data-theme="sage-mist"] .header.themed p,
[data-theme="sage-mist"] .header.themed .event-badge {
    color: #3d4a38;
}

[data-theme="blush-rose"] .composer-avatar,
[data-theme="blush-rose"] .post-avatar {
    color: #5c4a45;
}

[data-theme="ivory-cream"] .composer-avatar,
[data-theme="ivory-cream"] .post-avatar {
    color: #5c5348;
}

[data-theme="sage-mist"] .composer-avatar,
[data-theme="sage-mist"] .post-avatar {
    color: #3d4a38;
}

[data-theme="champagne-gold"] .composer-avatar,
[data-theme="champagne-gold"] .post-avatar,
[data-theme="dusty-mauve"] .composer-avatar,
[data-theme="dusty-mauve"] .post-avatar {
    color: #fff;
}

[data-theme="blush-rose"] .btn-primary {
    color: #5c4a45;
}

[data-theme="ivory-cream"] .btn-primary {
    color: #5c5348;
}

[data-theme="sage-mist"] .btn-primary {
    color: #3d4a38;
}

[data-theme="champagne-gold"] .btn-primary,
[data-theme="dusty-mauve"] .btn-primary {
    color: #fff;
}

/* Organizer page: QR section & other buttons – theme-aware text (light themes = dark text) */
[data-theme="blush-rose"] .btn-copy,
[data-theme="blush-rose"] .btn-download,
[data-theme="blush-rose"] .moderation-tab.active {
    color: #5c4a45;
}
[data-theme="ivory-cream"] .btn-copy,
[data-theme="ivory-cream"] .btn-download,
[data-theme="ivory-cream"] .moderation-tab.active {
    color: #5c5348;
}
[data-theme="sage-mist"] .btn-copy,
[data-theme="sage-mist"] .btn-download,
[data-theme="sage-mist"] .moderation-tab.active {
    color: #3d4a38;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #65676b;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

/* Links */
a {
    color: var(--theme-primary);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

/* Mobile Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem 0.5rem;
    }

    .card {
        border-radius: 0;
        padding: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.125rem;
    }
}

/* Import a modern, celebratory font */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* Override header styles for event pages */
.header.themed {
    background: linear-gradient(135deg, var(--theme-gradient-start), var(--theme-gradient-end));
    color: white;
    border-bottom: none;
    padding: 1rem 1rem;
    position: relative;
    overflow: hidden;
    min-height: 140px;
}

    /* Animated gradient background */
    .header.themed::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient( 135deg, var(--theme-gradient-start), var(--theme-gradient-end), var(--theme-gradient-start) );
        background-size: 200% 200%;
        animation: gradientShift 8s ease infinite;
        opacity: 0.3;
        z-index: 0;
    }

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Floating shapes decoration */
.header.themed::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite;
    z-index: 0;
}

/* White theme - use darker floating shape */
[data-theme="white"] .header.themed::after {
    background: radial-gradient(circle, rgba(31, 41, 55, 0.05) 0%, transparent 70%);
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(30px, -20px) scale(0.9);
    }
}

.header-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
}

/* Updated typography with modern font */
.header.themed h1 {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.6s ease-out;
}

.header.themed p {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0;
    line-height: 1.5;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.6s ease-out 0.1s backwards;
}

/* Premium themes - override header/event-date text (must come after .header.themed h1/p to win) */
[data-theme="blush-rose"] .header.themed,
[data-theme="blush-rose"] .header.themed h1,
[data-theme="blush-rose"] .header.themed p,
[data-theme="blush-rose"] .header.themed .event-badge,
[data-theme="blush-rose"] .header.themed .event-date {
    color: #5c4a45;
}
[data-theme="ivory-cream"] .header.themed,
[data-theme="ivory-cream"] .header.themed h1,
[data-theme="ivory-cream"] .header.themed p,
[data-theme="ivory-cream"] .header.themed .event-badge,
[data-theme="ivory-cream"] .header.themed .event-date {
    color: #5c5348;
}
[data-theme="sage-mist"] .header.themed,
[data-theme="sage-mist"] .header.themed h1,
[data-theme="sage-mist"] .header.themed p,
[data-theme="sage-mist"] .header.themed .event-badge,
[data-theme="sage-mist"] .header.themed .event-date {
    color: #3d4a38;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Event badge/pill decoration */
.event-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideDown 0.6s ease-out 0.2s backwards;
}

.event-badge-icon {
    font-size: 1.125rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Decorative elements */
.header-decoration {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient( 90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.3) );
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

/* White theme - darker shimmer */
[data-theme="white"] .header-decoration {
    background: linear-gradient( 90deg, rgba(31, 41, 55, 0.2), rgba(31, 41, 55, 0.4), rgba(31, 41, 55, 0.2) );
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Mobile responsive */
@media (max-width: 640px) {
    .header.themed {
        padding: 0.5rem 1rem;
        min-height: 120px;
    }

        .header.themed h1 {
            font-size: 1.5rem;
        }

        .header.themed p {
            font-size: 0.9375rem;
        }

    .event-badge {
        font-size: 0.8125rem;
        padding: 0.375rem 0.875rem;
    }
}

/* ========================================
   PHOTO GALLERY SPECIFIC STYLES
   ======================================== */

/* Photo grid container - always white background */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
    background: var(--bg-surface); /* Pure white behind photos */
    padding: 1rem;
    border-radius: 8px;
}

/* Individual photo items */
.photo-item {
    background: var(--bg-surface);
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 1;
    position: relative;
}

    .photo-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* Upload section - can use accent background */
.upload-section {
    background: var(--bg-accent); /* Subtle tinted section */
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.upload-dropzone {
    background: var(--bg-surface); /* White dropzone */
    border: 2px dashed var(--theme-primary);
    border-radius: 8px;
    padding: 2rem;
    transition: all 0.2s;
}

    .upload-dropzone:hover,
    .upload-dropzone.is-dragover {
        background: var(--bg-hover); /* Light tint on hover */
        border-color: var(--theme-primary-hover);
    }

/* Section dividers with subtle tint */
.section-divider {
    height: 1px;
    background: linear-gradient( to right, transparent, var(--bg-accent), transparent );
    margin: 2rem 0;
}
