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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    min-height: 100vh;
    color: #fff;
    position: relative;
    overflow-x: hidden;
}

/* Snowfall Animation */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: white;
    font-size: 1em;
    opacity: 0.8;
    animation: fall linear infinite;
    user-select: none;
}

@keyframes fall {
    to {
        transform: translateY(100vh);
    }
}

/* Header Styles */
header {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 10;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.5);
    }
    to {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 215, 0, 0.6);
    }
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.current-date {
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: bold;
    margin-top: 0.5rem;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
}

.intro-message {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

/* Elf Cards */
.elf-card {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.elf-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.elf-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.elf-avatar {
    font-size: 4rem;
    margin-right: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.elf-info h2 {
    color: #1e3c72;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.child-age {
    color: #666;
    font-size: 1.1rem;
}

/* Status Badge */
.status-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.status-badge.in-transit {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.status-badge.out-for-delivery {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.status-badge.delivered {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.status-icon {
    font-size: 1.5rem;
}

/* Timeline */
.tracking-timeline {
    margin-top: 1.5rem;
}

.timeline-item {
    display: flex;
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 3.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 1.25rem;
    top: 2.5rem;
    width: 2px;
    height: calc(100% + 1rem);
    background: #ddd;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: white;
    border: 3px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 1;
}

.timeline-item.completed .timeline-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.timeline-item.current .timeline-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: #f5576c;
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 87, 108, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(245, 87, 108, 0);
    }
}

.timeline-content {
    flex: 1;
}

.timeline-date {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.timeline-description {
    color: #666;
    line-height: 1.5;
}

.timeline-location {
    color: #999;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    margin-top: 3rem;
    position: relative;
    z-index: 10;
}

footer p {
    margin-bottom: 0.5rem;
}

.footer-note {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Landing Page Styles */
.landing-container {
    max-width: 600px;
}

.tracking-input-card {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border-radius: 20px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.santa-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

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

.tracking-input-card h2 {
    color: #1e3c72;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.instruction {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

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

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    color: #333;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.track-button {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.track-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.track-button:active {
    transform: translateY(0);
}

.error-message {
    display: none;
    color: #dc2626;
    background: #fee2e2;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    font-weight: 500;
}

.help-text {
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.preview-elves {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    text-align: center;
}

.preview-elves h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.elf-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.preview-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.preview-icon span {
    display: block;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Shake animation for error */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* Tracking Number Display */
.tracking-number-display {
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: bold;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.tracking-number-display .label {
    opacity: 0.8;
    margin-right: 0.5rem;
}

/* Back Link */
.back-link {
    text-align: center;
    margin-top: 2rem;
}

.back-link a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    display: inline-block;
    transition: background 0.3s ease;
}

.back-link a:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Tracking Map */
.tracking-map-container {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.map-title {
    text-align: center;
    color: #1e3c72;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.tracking-map {
    background: linear-gradient(180deg, #87ceeb 0%, #b3d9ff 100%);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.map-svg {
    width: 100%;
    height: auto;
    display: block;
}

.ocean {
    opacity: 1;
}

.journey-path {
    fill: none;
    stroke: #999;
    stroke-width: 2;
    opacity: 0.3;
}

.journey-path-active {
    fill: none;
    stroke: url(#magicPath);
    stroke-width: 5;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawPath 3s ease-out forwards;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

.location-marker {
    opacity: 0;
    animation: fadeInMarker 0.5s ease-out forwards;
}

.location-marker:nth-child(3) { animation-delay: 0.3s; }
.location-marker:nth-child(4) { animation-delay: 0.6s; }
.location-marker:nth-child(5) { animation-delay: 0.9s; }
.location-marker:nth-child(6) { animation-delay: 1.2s; }

@keyframes fadeInMarker {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.marker-circle {
    fill: #667eea;
    stroke: white;
    stroke-width: 3;
    transition: all 0.3s ease;
    cursor: pointer;
}

.marker-circle:hover {
    fill: #764ba2;
    r: 14;
}

.marker-circle.destination {
    fill: #ff6b9d;
    animation: pulse-destination 2s ease-in-out infinite;
}

@keyframes pulse-destination {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.marker-circle.active {
    fill: #ffd700;
    animation: pulse-active 1.5s ease-in-out infinite;
}

@keyframes pulse-active {
    0%, 100% {
        r: 10;
        opacity: 1;
    }
    50% {
        r: 14;
        opacity: 0.7;
    }
}

.marker-label {
    fill: #333;
    font-size: 14px;
    font-weight: bold;
    text-anchor: middle;
    pointer-events: none;
}

.moving-elf {
    opacity: 0;
    transform-origin: center;
}

.moving-elf.active {
    opacity: 1;
    animation: elfBounce 2s ease-in-out infinite;
}

@keyframes elfBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.map-subtitle {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* THEME: Pink (Luella) */
body.theme-pink {
    background: linear-gradient(135deg, #ff6b9d 0%, #c86dd7 50%, #ff8fab 100%);
}

body.theme-pink .elf-avatar {
    background: linear-gradient(135deg, #ff6b9d 0%, #ffa6c1 100%);
}

body.theme-pink .elf-info h2 {
    color: #c41e5a;
}

body.theme-pink .timeline-date {
    color: #ff6b9d;
}

body.theme-pink .timeline-item.completed .timeline-icon {
    background: linear-gradient(135deg, #ff6b9d 0%, #ffa6c1 100%);
    border-color: #ff6b9d;
}

body.theme-pink .timeline-item.current .timeline-icon {
    background: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%);
    border-color: #ff1493;
}

body.theme-pink .timeline-item.current .timeline-icon {
    animation: pulse-pink 2s ease-in-out infinite;
}

@keyframes pulse-pink {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 157, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 107, 157, 0);
    }
}

body.theme-pink .status-badge {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff1493 100%);
}

body.theme-pink .status-badge.in-transit {
    background: linear-gradient(135deg, #ff69b4 0%, #ff8fab 100%);
}

body.theme-pink .status-badge.out-for-delivery {
    background: linear-gradient(135deg, #ffa6c1 0%, #ff6b9d 100%);
}

body.theme-pink .status-badge.delivered {
    background: linear-gradient(135deg, #ff1493 0%, #c41e5a 100%);
}

body.theme-pink .map-title {
    color: #c41e5a;
}

body.theme-pink .marker-circle {
    fill: #ff6b9d;
}

body.theme-pink .marker-circle:hover {
    fill: #ff1493;
}

body.theme-pink .marker-circle.active {
    fill: #ffd700;
}

body.theme-pink .marker-circle.destination {
    fill: #c41e5a;
}

/* THEME: Blue-Purple (Tormund) */
body.theme-blue-purple {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #764ba2 100%);
}

body.theme-blue-purple .elf-avatar {
    background: linear-gradient(135deg, #4facfe 0%, #667eea 100%);
}

body.theme-blue-purple .elf-info h2 {
    color: #1e3c72;
}

body.theme-blue-purple .timeline-date {
    color: #4facfe;
}

body.theme-blue-purple .timeline-item.completed .timeline-icon {
    background: linear-gradient(135deg, #4facfe 0%, #667eea 100%);
    border-color: #4facfe;
}

body.theme-blue-purple .timeline-item.current .timeline-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

body.theme-blue-purple .timeline-item.current .timeline-icon {
    animation: pulse-blue 2s ease-in-out infinite;
}

@keyframes pulse-blue {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(79, 172, 254, 0);
    }
}

body.theme-blue-purple .status-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.theme-blue-purple .status-badge.in-transit {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body.theme-blue-purple .status-badge.out-for-delivery {
    background: linear-gradient(135deg, #667eea 0%, #4facfe 100%);
}

body.theme-blue-purple .status-badge.delivered {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
}

body.theme-blue-purple .map-title {
    color: #1e3c72;
}

body.theme-blue-purple .marker-circle {
    fill: #4facfe;
}

body.theme-blue-purple .marker-circle:hover {
    fill: #667eea;
}

body.theme-blue-purple .marker-circle.active {
    fill: #ffd700;
}

body.theme-blue-purple .marker-circle.destination {
    fill: #764ba2;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .elf-card {
        padding: 1.5rem;
    }

    .elf-header {
        flex-direction: column;
        text-align: center;
    }

    .elf-avatar {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .intro-message {
        font-size: 1.1rem;
    }

    .tracking-input-card {
        padding: 2rem 1.5rem;
    }

    .tracking-input-card h2 {
        font-size: 1.5rem;
    }

    .elf-icons {
        gap: 1.5rem;
    }

    .preview-icon {
        font-size: 2.5rem;
    }

    .tracking-number-display {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }

    .tracking-map-container {
        padding: 1.5rem 1rem;
    }

    .map-title {
        font-size: 1.2rem;
    }

    .marker-label {
        font-size: 11px;
    }

    .map-subtitle {
        font-size: 0.85rem;
    }
}
