/* ==========================================================================
   Secret Santa Generator - Styles
   A warm, festive design with depth and character
   ========================================================================== */

:root {
    /* Color Palette - Deep forest greens with warm gold accents */
    --forest-deep: #0d2818;
    --forest-mid: #1a4d2e;
    --forest-light: #2d6a4f;
    --gold-warm: #d4a373;
    --gold-bright: #e9c46a;
    --gold-pale: #f4e4bc;
    --cream: #fefae0;
    --cream-dark: #f5f0d6;
    --berry: #9d4348;
    --berry-light: #c9616a;
    
    /* Semantic Colors */
    --bg-primary: var(--forest-deep);
    --bg-card: rgba(254, 250, 224, 0.97);
    --text-primary: var(--forest-deep);
    --text-muted: #4a5c50;
    --accent: var(--gold-warm);
    --accent-hover: var(--gold-bright);
    
    /* Typography */
    --font-display: 'Crimson Pro', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Effects */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-soft: 0 4px 20px rgba(13, 40, 24, 0.15);
    --shadow-lifted: 0 8px 40px rgba(13, 40, 24, 0.2);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    
    /* Rich layered background */
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(45, 106, 79, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(157, 67, 72, 0.2) 0%, transparent 40%),
        linear-gradient(180deg, var(--forest-deep) 0%, #0a1f12 100%);
    background-attachment: fixed;
}

/* ==========================================================================
   Snowflakes Animation
   ========================================================================== */

.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10%;
    color: rgba(254, 250, 224, 0.4);
    font-size: 1.5rem;
    animation: snowfall linear infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.snowflake:nth-child(1) { left: 5%; animation-duration: 15s; animation-delay: 0s; font-size: 1.2rem; }
.snowflake:nth-child(2) { left: 15%; animation-duration: 12s; animation-delay: 2s; font-size: 1.8rem; }
.snowflake:nth-child(3) { left: 25%; animation-duration: 18s; animation-delay: 4s; font-size: 1rem; }
.snowflake:nth-child(4) { left: 35%; animation-duration: 14s; animation-delay: 1s; font-size: 1.5rem; }
.snowflake:nth-child(5) { left: 50%; animation-duration: 16s; animation-delay: 3s; font-size: 1.3rem; }
.snowflake:nth-child(6) { left: 60%; animation-duration: 13s; animation-delay: 5s; font-size: 1.7rem; }
.snowflake:nth-child(7) { left: 70%; animation-duration: 17s; animation-delay: 2.5s; font-size: 1.1rem; }
.snowflake:nth-child(8) { left: 80%; animation-duration: 11s; animation-delay: 0.5s; font-size: 1.6rem; }
.snowflake:nth-child(9) { left: 88%; animation-duration: 19s; animation-delay: 4.5s; font-size: 1.4rem; }
.snowflake:nth-child(10) { left: 95%; animation-duration: 14s; animation-delay: 1.5s; font-size: 1.2rem; }

@keyframes snowfall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    position: relative;
    z-index: 10;
    max-width: 700px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
    min-height: calc(100vh - 60px);
}

.view {
    animation: fadeIn 0.5s ease-out;
}

.view.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Header
   ========================================================================== */

header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    animation: slideDown 0.6s ease-out;
}

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

.logo {
    font-size: 4rem;
    margin-bottom: var(--space-md);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: gentle-bounce 3s ease-in-out infinite;
}

@keyframes gentle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 600;
    color: var(--cream);
    letter-spacing: 0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: var(--space-sm);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--gold-pale);
    opacity: 0.9;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(212, 163, 115, 0.2);
    animation: cardAppear 0.5s ease-out backwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--forest-deep);
    margin-bottom: var(--space-xs);
}

.card .hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.participants-list,
.tiers-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.participant-row,
.tier-row {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.participant-row input,
.tier-row input {
    flex: 1;
    padding: var(--space-md);
    font-family: var(--font-body);
    font-size: 1rem;
    border: 2px solid rgba(45, 106, 79, 0.2);
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-primary);
    transition: var(--transition);
}

.participant-row input:focus,
.tier-row input:focus {
    outline: none;
    border-color: var(--forest-light);
    box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.1);
}

.participant-row input::placeholder,
.tier-row input::placeholder {
    color: #9ca3af;
}

.tier-row .price-input {
    max-width: 120px;
}

.tier-row .tier-name-input {
    flex: 2;
}

.btn-remove {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(157, 67, 72, 0.1);
    color: var(--berry);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove:hover {
    background: var(--berry);
    color: white;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--forest-mid) 0%, var(--forest-light) 100%);
    color: var(--cream);
    box-shadow: 0 4px 15px rgba(26, 77, 46, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(26, 77, 46, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--forest-mid);
    border: 2px dashed rgba(45, 106, 79, 0.3);
}

.btn-secondary:hover {
    border-color: var(--forest-mid);
    background: rgba(45, 106, 79, 0.05);
}

.btn-secondary span {
    font-size: 1.2rem;
    font-weight: 600;
}

.actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

/* ==========================================================================
   Results View
   ========================================================================== */

.validation-display {
    background: rgba(45, 106, 79, 0.08);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
}

.validation-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
}

.validation-row .name {
    color: var(--forest-mid);
    font-weight: 600;
    min-width: 100px;
}

.validation-row .arrow {
    color: var(--gold-warm);
}

.validation-row .hash {
    color: var(--text-muted);
    opacity: 0.7;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.link-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(45, 106, 79, 0.05);
    border-radius: var(--radius-md);
    animation: slideIn 0.3s ease-out backwards;
}

.link-row:nth-child(1) { animation-delay: 0.1s; }
.link-row:nth-child(2) { animation-delay: 0.15s; }
.link-row:nth-child(3) { animation-delay: 0.2s; }
.link-row:nth-child(4) { animation-delay: 0.25s; }
.link-row:nth-child(5) { animation-delay: 0.3s; }

.link-row .participant-name {
    font-weight: 600;
    color: var(--forest-mid);
    min-width: 100px;
}

.link-row .link-input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
    border: 1px solid rgba(45, 106, 79, 0.2);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-copy {
    padding: var(--space-sm) var(--space-md);
    background: var(--gold-warm);
    color: var(--forest-deep);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--gold-bright);
}

.btn-copy.copied {
    background: var(--forest-light);
    color: white;
}

/* ==========================================================================
   Reveal View
   ========================================================================== */

.reveal-section {
    text-align: center;
}

.assignments-reveal {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.assignment-card {
    background: linear-gradient(135deg, rgba(233, 196, 106, 0.15) 0%, rgba(212, 163, 115, 0.1) 100%);
    border: 2px solid var(--gold-warm);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    animation: revealPop 0.5s ease-out backwards;
}

.assignment-card:nth-child(1) { animation-delay: 0.2s; }
.assignment-card:nth-child(2) { animation-delay: 0.4s; }
.assignment-card:nth-child(3) { animation-delay: 0.6s; }

@keyframes revealPop {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateX(-15deg);
    }
    70% {
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateX(0);
    }
}

.assignment-card .tier-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
}

.assignment-card .price-tag {
    display: inline-block;
    background: var(--gold-warm);
    color: var(--forest-deep);
    padding: var(--space-xs) var(--space-md);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

.assignment-card .recipient-name {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--forest-deep);
    margin: var(--space-md) 0;
}

.assignment-card .gift-icon {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    text-align: center;
    padding: var(--space-xl);
    color: var(--gold-pale);
    opacity: 0.6;
    font-size: 0.85rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
    .container {
        padding: var(--space-md);
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .card {
        padding: var(--space-lg);
    }
    
    .tier-row {
        flex-wrap: wrap;
    }
    
    .tier-row .tier-name-input {
        flex: 1 1 100%;
        order: 1;
    }
    
    .tier-row .price-input {
        flex: 1;
        order: 2;
        max-width: none;
    }
    
    .tier-row .btn-remove {
        order: 3;
    }
    
    .link-row {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .link-row .participant-name {
        min-width: auto;
    }
    
    .assignment-card .recipient-name {
        font-size: 2rem;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

