/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Progress bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #ffd700, #ff6b6b);
    transition: width 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 1s ease-out;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #ffd700, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1rem !important;
    opacity: 0.7 !important;
    font-style: italic;
}

/* Navigation controls */
.controls {
    text-align: center;
    margin: 30px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover, .btn:focus {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

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

/* Story container */
.story-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

/* Layer styles */
.layer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateX(-100px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.layer.visible {
    transform: translateX(0);
    opacity: 1;
}

.layer:hover, .layer:focus {
    transform: translateX(10px) scale(1.02);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Shimmer effect */
.layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s;
}

.layer:hover::before {
    left: 100%;
}

/* Layer number */
.layer-number {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Layer content */
.layer-content {
    flex: 1;
}

.layer-title {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.layer-description {
    font-size: 1.05rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 8px;
}

.layer-tech {
    font-size: 0.9rem;
    opacity: 0.7;
    color: #b3d9ff;
    font-style: italic;
}

/* Final message */
.final-message {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-top: 40px;
    animation: pulse 2s infinite;
    transform: translateY(50px);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.final-message.visible {
    transform: translateY(0);
    opacity: 1;
}

.message-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hello-world {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.message-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.7;
}

.footer p {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.footer a {
    color: #ffd700;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 { 
        font-size: 2rem; 
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .layer { 
        padding: 20px 15px;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .layer-number {
        align-self: center;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn { 
        padding: 10px 20px; 
        width: 200px;
        justify-content: center;
    }
    
    .hello-world {
        font-size: 2rem;
    }
    
    .final-message {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .layer-title {
        font-size: 1.2rem;
    }
    
    .layer-description {
        font-size: 1rem;
    }
    
    .layer-tech {
        font-size: 0.85rem;
    }
}

/* Accessibility improvements */
.layer:focus {
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

.btn:focus {
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .controls, .progress-bar {
        display: none;
    }
    
    .layer {
        opacity: 1;
        transform: none;
        break-inside: avoid;
        margin-bottom: 20px;
    }
}