/* styles.css - Custom styles and animations */

/* Root styles */
:root {
    --primary: #22C55E;
    --secondary: #FCD34D;
    --accent: #06B6D4;
    --text: #1F2937;
    --text-light: #6B7280;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    background: white;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

/* Story container styles */
#story-content {
    width: 100%;
    position: relative;
}

/* Block base styles */
[data-animation] {
    position: relative;
    opacity: 0;
}

/* Hero section specific */
#block_1 {
    animation: none;
}

/* Text emphasis styles */
.text-emphasis {
    border-left: 4px solid var(--primary);
    padding-left: 24px;
    margin-left: 0;
}

/* Before/After morphing effect */
[data-morph-before-after] {
    position: relative;
    overflow: hidden;
}

[data-before] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

[data-after] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

[data-morph-slider] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

/* Image container shadows and borders */
.before-after-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.before-after-container img {
    display: block;
    width: 100%;
    height: auto;
}

/* Label styles for before/after */
.before-label, .after-label {
    position: absolute;
    bottom: 16px;
    font-weight: 700;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    z-index: 10;
}

.before-label {
    left: 16px;
}

.after-label {
    right: 16px;
}

/* Product cards animation styles */
[data-card] {
    transition: all 0.3s ease;
    transform-origin: center;
}

[data-card]:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(34, 197, 94, 0.15);
}

[data-card] img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

[data-card]:hover img {
    transform: scale(1.05);
}

/* Testimonial block styles */
.testimonial-container {
    background: linear-gradient(135deg, #f3e8ff 0%, #fce7f3 100%);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
}

.testimonial-quote {
    font-size: 20px;
    font-style: italic;
    color: var(--text);
    margin-bottom: 20px;
    line-height: 1.8;
}

.testimonial-author {
    font-weight: 600;
    font-size: 18px;
    color: var(--primary);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
}

/* CTA Button styles */
button {
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    border-radius: 8px;
    padding: 16px 32px;
    font-size: 16px;
}

button:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #16a34a;
    box-shadow: 0 8px 16px rgba(34, 197, 94, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: #f0fdf4;
}

/* Loading animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

#loading {
    position: fixed;
    inset: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#loading .animate-spin {
    animation: spin 1s linear infinite;
}

/* Scroll to site overlay */
#scroll-to-site-overlay {
    background: white;
    will-change: opacity;
}

/* Opacity animations for elements */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Smooth transitions for text content */
p, h1, h2, h3 {
    transition: opacity 0.3s ease;
}

/* Parallax container */
[data-parallax="true"] {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    h1 {
        font-size: 28px;
    }
    
    h2 {
        font-size: 24px;
    }
    
    p {
        font-size: 16px;
    }
    
    button {
        width: 100%;
        padding: 12px 24px;
    }
    
    .testimonial-container {
        padding: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .before-label, .after-label {
        font-size: 12px;
        padding: 6px 12px;
        bottom: 12px;
    }
}

/* Smooth scroll behavior for anchor links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.8;
}

/* Utility classes */
.container-prose {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-soft {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.shadow-medium {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.shadow-hard {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

/* Icon styles */
[data-icon] {
    font-size: 48px;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

[data-icon]:hover {
    transform: scale(1.1);
}

/* Highlight box styles */
.highlight-box {
    background: linear-gradient(135deg, #dcfce7 0%, #ecfdf5 100%);
    border-left: 4px solid var(--primary);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

/* Pulse animation for important elements */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Focus states for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    #loading,
    button {
        display: none;
    }
}

/* Smooth image loading */
img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}
