/* ===================================
   Ozana Staff Wrapped - Design System
   =================================== */

:root {
    /* Colors */
    --primary: #ec5800;
    --primary-light: #ff7a2e;
    --primary-dark: #c94a00;
    --dark: #1a1a2e;
    --dark-lighter: #252542;
    --cream: #fff5eb;
    --white: #ffffff;
    --gray: #94a3b8;
    --success: #10b981;
    --error: #ef4444;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #ec5800 0%, #ff7a2e 50%, #ffa366 100%);
    --gradient-dark: linear-gradient(180deg, #1a1a2e 0%, #252542 100%);
    --gradient-warm: linear-gradient(135deg, #ec5800 0%, #ff6b35 50%, #f7931e 100%);

    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 40px rgba(236, 88, 0, 0.3);
}

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

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background: var(--dark);
    color: var(--cream);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ===================================
   Animated Background
   =================================== */

.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    z-index: -2;
}

.gradient-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(236, 88, 0, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(255, 122, 46, 0.1) 0%, transparent 40%);
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(2%, 2%) rotate(5deg);
    }

    66% {
        transform: translate(-2%, 1%) rotate(-5deg);
    }
}

/* ===================================
   Login Page
   =================================== */

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-lg);
}

.login-card {
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.logo {
    width: 180px;
    height: auto;
    margin-bottom: var(--space-xl);
    filter: drop-shadow(0 4px 20px rgba(236, 88, 0, 0.3));
}

.title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
}

.subtitle {
    color: var(--gray);
    font-size: 1rem;
    margin-bottom: var(--space-2xl);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.input-group {
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray);
    margin-bottom: var(--space-sm);
}

.input-group input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
    font-family: var(--font-body);
    background: var(--dark-lighter);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--cream);
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: var(--gray);
    opacity: 0.6;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(236, 88, 0, 0.15);
}

.input-group input.error {
    border-color: var(--error);
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-8px);
    }

    40%,
    80% {
        transform: translateX(8px);
    }
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    background: var(--gradient-warm);
    border: none;
    border-radius: var(--radius-md);
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 50px rgba(236, 88, 0, 0.4);
}

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

.error-message {
    color: var(--error);
    font-size: 0.875rem;
    min-height: 1.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.visible {
    opacity: 1;
}

.footer-text {
    position: fixed;
    bottom: var(--space-lg);
    color: var(--gray);
    font-size: 0.75rem;
    opacity: 0.6;
}

/* ===================================
   Animations
   =================================== */

.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
    opacity: 0;
}

.animate-slide-up {
    animation: slideUp 0.8s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.delay-1 {
    animation-delay: 0.15s;
}

.delay-2 {
    animation-delay: 0.3s;
}

.delay-3 {
    animation-delay: 0.45s;
}

.delay-4 {
    animation-delay: 0.6s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

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

/* ===================================
   Wrapped / Stories Page
   =================================== */

.stories-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    touch-action: pan-y;
}

/* Progress Bar */
.progress-bar-container {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    right: var(--space-md);
    display: flex;
    gap: 6px;
    z-index: 100;
}

.progress-segment {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-segment .fill {
    height: 100%;
    width: 0;
    background: var(--white);
    border-radius: var(--radius-full);
}

.progress-segment.active .fill {
    animation: progressFill 5s linear forwards;
}

.progress-segment.completed .fill {
    width: 100%;
}

@keyframes progressFill {
    to {
        width: 100%;
    }
}

/* Story Slide */
.story-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-lg);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.story-slide.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Story Content */
.story-header {
    position: absolute;
    top: calc(var(--space-md) + 20px);
    left: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.story-logo {
    width: 32px;
    height: auto;
}

.story-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cream);
}

.story-content {
    text-align: center;
    width: 100%;
    max-width: 320px;
}

.story-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gray);
    margin-bottom: var(--space-md);
}

.story-value {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: var(--space-sm);
}

.story-value.counting {
    transition: none;
}

.story-subtitle {
    font-size: 1.25rem;
    color: var(--cream);
    font-weight: 500;
}

/* Product List */
.product-list {
    list-style: none;
    width: 100%;
    max-width: 300px;
}

.product-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateX(-20px);
}

.product-item.visible {
    animation: slideInLeft 0.5s ease forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.product-rank {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 2rem;
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 600;
    color: var(--cream);
}

.product-units {
    font-size: 0.875rem;
    color: var(--gray);
}

/* Summary Slide */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    width: 100%;
    max-width: 320px;
    margin-top: var(--space-lg);
}

.summary-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.summary-card.full-width {
    grid-column: span 2;
}

.summary-card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    margin-bottom: var(--space-xs);
}

.summary-card-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Download Button */
.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
    padding: var(--space-md) var(--space-xl);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-body);
    background: var(--gradient-warm);
    border: none;
    border-radius: var(--radius-full);
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.download-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Navigation Areas */
.nav-left,
.nav-right {
    position: absolute;
    top: 80px;
    bottom: 0;
    width: 30%;
    z-index: 50;
    cursor: pointer;
}

.nav-left {
    left: 0;
}

.nav-right {
    right: 0;
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
}

/* Mobile Responsive */
@media (max-width: 380px) {
    .title {
        font-size: 1.75rem;
    }

    .story-value {
        font-size: 3rem;
    }

    .story-value-week {
        font-size: 1.5rem;
    }

    .product-name {
        font-size: 0.85rem;
    }

    .summary-card-value {
        font-size: 1rem;
    }

    .summary-card-value-small {
        font-size: 0.85rem;
    }
}

@media (min-width: 768px) {
    .login-card {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-lg);
        padding: var(--space-2xl);
        backdrop-filter: blur(10px);
    }
}

/* Week value - smaller font for date range */
.story-value-week {
    font-size: 1.75rem;
    line-height: 1.3;
}

/* Product name adjustments for longer names */
.product-name {
    font-size: 0.9rem;
    line-height: 1.3;
    word-wrap: break-word;
}

/* More products slide - compact styling */
#slide-3 .product-item {
    padding: var(--space-sm) 0;
}

#slide-3 .product-rank {
    font-size: 1.1rem;
    min-width: 2.5rem;
}

#slide-3 .product-name {
    font-size: 0.8rem;
}

#slide-3 .product-units {
    font-size: 0.75rem;
}

/* Summary card value variants */
.summary-card-value-small {
    font-size: 0.95rem;
    line-height: 1.3;
}

/* Summary slide scroll for smaller screens */
#slide-7 .story-content {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-bottom: var(--space-lg);
}

/* Pulse animation for summary cards */
@keyframes pulse {

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

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

.summary-card:hover {
    animation: pulse 1s ease infinite;
}