/* ===================================
   Le Calendrier Perdu - Styles
   Mobile-first PWA
   =================================== */

/* Variables */
:root {
    --pup-orange: #FF6B00;
    --pup-orange-dark: #E55A00;
    --pup-orange-light: #FF8A33;
    --tropical-sand: #F5E6D3;
    --night-blue: #1A2332;
    --night-blue-light: #2C3E50;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --text-light: #95A5A6;
    --success: #27AE60;
    --error: #E74C3C;
    --warning: #F39C12;
    --white: #FFFFFF;
    --gray-light: #ECF0F1;
    --gray: #BDC3C7;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition: all 0.3s ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--night-blue) 0%, var(--night-blue-light) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--pup-orange);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--pup-orange-dark);
}

/* Utilities */
[x-cloak] {
    display: none !important;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--white);
}

h2 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
}

p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(26, 35, 50, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    height: 50px;
    width: auto;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--pup-orange), var(--pup-orange-dark));
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-text {
    background: transparent;
    color: var(--pup-orange);
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-text:hover {
    color: var(--pup-orange-light);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5rem 1rem 2rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/assets/images/hero-bg.jpg') center/cover;
    opacity: 0.3;
    z-index: -1;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(26, 35, 50, 0.5) 0%, 
        rgba(26, 35, 50, 0.9) 100%);
}

.hero-content {
    text-align: center;
    z-index: 1;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--pup-orange), var(--pup-orange-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--tropical-sand);
    margin-bottom: 2rem;
}

/* Countdown */
.countdown {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 2rem 0;
}

.countdown-label {
    color: var(--tropical-sand);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.countdown-timer {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.countdown-item {
    text-align: center;
}

.countdown-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--pup-orange);
}

.countdown-unit {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
}

/* Story Section */
.story {
    padding: 3rem 0;
    background: var(--white);
}

.story-card {
    background: var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.story-title {
    color: var(--night-blue);
    margin-bottom: 1.5rem;
    text-align: center;
}

.story-content p {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.story-content strong {
    color: var(--pup-orange);
}

/* Keys Section */
.keys {
    padding: 3rem 0;
    background: linear-gradient(180deg, var(--white) 0%, var(--gray-light) 100%);
}

.section-title {
    text-align: center;
    color: var(--night-blue);
    margin-bottom: 2rem;
}

.keys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.key-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    opacity: 0.5;
}

.key-card.unlocked {
    opacity: 1;
}

.key-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.key-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.key-card h3 {
    color: var(--night-blue);
    margin-bottom: 0.5rem;
}

.key-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Rules Section */
.rules {
    padding: 3rem 0;
    background: var(--white);
}

.rules-list {
    display: grid;
    gap: 1.5rem;
}

.rule-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.rule-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--pup-orange);
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.rule-content h4 {
    color: var(--night-blue);
    margin-bottom: 0.25rem;
}

.rule-content p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 2000;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray);
    cursor: pointer;
    line-height: 1;
}

.modal-title {
    color: var(--night-blue);
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--pup-orange);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    text-align: center;
}

.alert.error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error);
}

.alert.success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success);
}

.alert.warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning);
}

/* Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 1500;
}

.install-prompt p {
    margin: 0;
    color: var(--text-primary);
}

/* Footer */
.footer {
    background: var(--night-blue);
    color: var(--text-light);
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-light);
}

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

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

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

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

.pulse {
    animation: pulse 2s infinite;
}

/* Media Queries */
@media (min-width: 768px) {
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .countdown-value {
        font-size: 3rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* Enigma Pages Specific */
.enigma-container {
    min-height: 100vh;
    padding-top: 80px;
    padding-bottom: 2rem;
}

.enigma-header {
    text-align: center;
    margin-bottom: 2rem;
}

.enigma-progress {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--gray);
    transition: var(--transition);
}

.progress-dot.active {
    background: var(--pup-orange);
    transform: scale(1.5);
}

.progress-dot.completed {
    background: var(--success);
}

.enigma-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}

.enigma-story {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-style: italic;
}

.enigma-puzzle {
    background: var(--gray-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.hint-timer {
    background: rgba(243, 156, 18, 0.1);
    border: 2px solid var(--warning);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

.hint-box {
    background: rgba(39, 174, 96, 0.1);
    border: 2px solid var(--success);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.answer-form {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.answer-input {
    flex: 1;
}

/* PWA specific */
@media (display-mode: standalone) {
    .install-prompt {
        display: none;
    }
}

/* Loading states */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--pup-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Theme variations for enigmas */
.theme-night-lights {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.theme-feast-warm {
    background: linear-gradient(135deg, #ff6b35 0%, #f77b71 100%);
}

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

.theme-epic-horizon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}