/**
 * Main Stylesheet - Happy Smile Wishes Theme
 * Tailwind-inspired utility-first CSS
 * 
 * @package Happy_Smile_Wishes
 * @since 2.1.0
 */

/* ========================================
   Reset & Base Styles
   ======================================== */

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

:root {
    /* Colors */
    --color-primary: #FF6B6B;
    --color-accent: #FFA07A;
    --color-bg-light: #FFF7F3;
    --color-bg-lighter: #FDE6DA;
    --color-text-dark: #3A2E29;
    --color-text-light: #6B5B54;
    --color-success: #4CAF50;
    --color-error: #F44336;
    --color-warning: #FFD93D;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text-dark);
    background: var(--color-bg-light);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }

.gradient-text {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Layout & Sections
   ======================================== */

.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
}

.site-header {
    background: white;
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-branding {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.site-title {
    font-size: var(--font-size-2xl);
    margin: 0;
}

.site-title a {
    color: var(--color-primary);
    text-decoration: none;
}

.site-footer {
    background: var(--color-text-dark);
    color: white;
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-2xl);
}

.footer-content {
    text-align: center;
}

.footer-navigation ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.footer-navigation a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity var(--transition-base);
}

.footer-navigation a:hover {
    opacity: 1;
}

/* ========================================
   Front Page - Smile Wall
   ======================================== */

.smile-wall-section {
    padding: var(--spacing-2xl) 0;
    background: linear-gradient(180deg, var(--color-bg-light) 0%, var(--color-bg-lighter) 100%);
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-content {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.hero-title {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

.smile-wall-canvas {
    width: 100%;
    height: 600px;
    position: relative;
    margin: var(--spacing-xl) 0;
}

.cta-container {
    text-align: center;
    margin-top: var(--spacing-xl);
}

/* ========================================
   Buttons
   ======================================== */

.btn,
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-base);
    font-weight: 600;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary,
.cta-button {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover,
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: white;
    color: var(--color-text-dark);
    border: 2px solid var(--color-bg-lighter);
}

.btn-accent {
    background: var(--color-accent);
    color: white;
}

.btn-pro {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: var(--color-text-dark);
}

.btn-large {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
}

.btn-link {
    background: none;
    color: var(--color-primary);
    padding: var(--spacing-xs);
}

/* Pulse/Glow Effect */
.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 107, 107, 0.8);
    }
}

/* ========================================
   Features & Cards
   ======================================== */

.features-section,
.stats-section {
    padding: var(--spacing-2xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.feature-card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    opacity: 0;
    transform: translateY(20px);
}

.feature-card.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

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

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

.feature-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
}

/* ========================================
   Stats Grid
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.stat-item {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: scale(0.9);
}

.stat-item.animate-in {
    animation: scaleIn 0.5s ease forwards;
}

@keyframes scaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.stat-number {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   Modal
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.modal-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: none;
    border: none;
    font-size: var(--font-size-3xl);
    color: var(--color-text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: background var(--transition-base);
}

.modal-close:hover {
    background: var(--color-bg-lighter);
}

.modal-step {
    display: none;
}

.modal-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.modal-title {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-sm);
}

.modal-subtitle {
    color: var(--color-text-light);
}

/* ========================================
   Forms
   ======================================== */

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--color-text-dark);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--color-bg-lighter);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.char-counter {
    display: block;
    text-align: right;
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    margin-top: var(--spacing-xs);
}

.char-counter.warning {
    color: var(--color-error);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.checkbox-label {
    display: flex;
    align-items: start;
    gap: var(--spacing-xs);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.form-message {
    margin-top: var(--spacing-md);
}

/* ========================================
   File Upload
   ======================================== */

.upload-area {
    border: 2px dashed var(--color-bg-lighter);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--color-primary);
    background: var(--color-bg-light);
}

.file-input {
    display: none;
}

.upload-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
}

.upload-hint {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
}

.upload-preview {
    position: relative;
}

.upload-preview img {
    max-width: 100%;
    border-radius: var(--radius-md);
}

.remove-image {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: var(--color-error);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    width: 32px;
    height: 32px;
    font-size: var(--font-size-xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Report Page
   ======================================== */

.report-header {
    text-align: center;
    padding: var(--spacing-2xl) 0;
    background: linear-gradient(180deg, var(--color-bg-light) 0%, white 100%);
}

.report-title {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
}

.report-meta {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    color: var(--color-text-light);
}

.report-section {
    padding: var(--spacing-2xl) 0;
}

.elements-chart {
    margin: var(--spacing-xl) 0;
    display: flex;
    justify-content: center;
}

.fortune-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.fortune-card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.fortune-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
}

.fortune-score {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--color-primary);
    margin: var(--spacing-md) 0;
}

.score-total {
    font-size: var(--font-size-lg);
    color: var(--color-text-light);
}

.fortune-bar {
    height: 10px;
    background: var(--color-bg-lighter);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: var(--spacing-md);
}

.fortune-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.insight-card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.pro-section {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFE6CC 100%);
    position: relative;
}

.pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: var(--color-text-dark);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.recommendation-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.recommendation-card.full-width {
    grid-column: 1 / -1;
}

.rec-icon {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-sm);
}

.color-swatch {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    margin: var(--spacing-md) auto;
    box-shadow: var(--shadow-md);
}

.report-actions {
    padding: var(--spacing-2xl) 0;
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

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

.success-content {
    text-align: center;
    padding: var(--spacing-xl);
}

.success-animation {
    margin: var(--spacing-xl) 0;
    position: relative;
}

.particle-burst {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    transition: all 1s ease-out;
}

.success-icon {
    font-size: 5rem;
    animation: bounce 1s ease infinite;
}

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

/* ========================================
   Notifications & Alerts
   ======================================== */

.notification {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    background: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    transform: translateX(400px);
    transition: transform var(--transition-base);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--color-success);
}

.notification-error {
    border-left: 4px solid var(--color-error);
}

.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
}

.alert-error {
    background: #FFEBEE;
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

.alert-success {
    background: #E8F5E9;
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

/* ========================================
   Loading Overlay
   ======================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--color-bg-lighter);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

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

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    :root {
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
    }
    
    .features-grid,
    .fortune-grid,
    .recommendations-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .modal-container {
        padding: var(--spacing-md);
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.modal-open {
    overflow: hidden;
}

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

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

