/* ========================================
   POVEȘTI MAGICE - STYLESHEET CENTRAL
   Platformă Educativă Interactivă
======================================== */

/* ========================================
   PALETĂ DE CULORI GLOBALĂ
======================================== */
:root {
    /* Culori Principale */
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #7c8ef0;
    --secondary-color: #764ba2;
    --secondary-dark: #5f3d84;
    --secondary-light: #8d5eb8;
    
    /* Culori Accent */
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --info-color: #4299e1;
    
    /* Culori Povești */
    --legenda-bradului: #66bb6a;
    --capra-iezi: #a0826d;
    --gainusa-rosie: #ffa500;
    --vulpea-barza: #ff8c42;
    --trei-ursi: #d4a574;
    --trei-purcelusi: #e8836f;
    --ridichea: #7cb342;
    --punguta: #d84315;
    --iepure-testoasa: #26a69a;
    --ratusca: #7986cb;
    --scufita: #c62828;
    --greierele: #afb42b;
    --coliba: #4fc3f7;
    --ursul: #795548;
    --corbul: #455a64;
    --leul: #c68a2e;
    --ciorba: #8d6e63;
    --tapii: #1976d2;
    --broscuta: #00897b;
    --anotimpuri: #ab47bc;
    
    /* Nuanțe Gri */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Gradiente */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-success: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.3);
    
    /* Typography */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 15px;
    --radius-lg: 25px;
    --radius-xl: 30px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.6s ease;
}

/* ========================================
   RESET & BASE STYLES
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: var(--line-height-base);
    color: var(--gray-800);
    background: var(--gradient-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

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

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-sm);
}

/* ========================================
   HEADER & NAVIGATION
======================================== */
.site-header {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.logo-icon {
    font-size: 3rem;
    animation: bounce 2s ease-in-out infinite;
}

.logo-text h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 0;
}

.logo-text p {
    font-size: 1rem;
    color: var(--gray-600);
    margin: 0;
}

/* ========================================
   HERO SECTION
======================================== */
.hero-section {
    padding: 4rem 0;
    text-align: center;
    color: white;
}

.hero-section h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 1s ease-out;
}

.hero-section p {
    font-size: 1.5rem;
    opacity: 0.95;
    animation: fadeIn 1s ease-out 0.3s both;
}

/* ========================================
   STORY CARDS
======================================== */
.story-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-slow);
    cursor: pointer;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.story-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.story-header {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.story-icon {
    font-size: 6rem;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
    animation: float 3s ease-in-out infinite;
}

.story-icon-img {
    width: 82%;
    max-height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.18));
    animation: float 3s ease-in-out infinite;
}

.story-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.story-title {
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.story-description {
    font-size: 1.1rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    flex: 1;
}

.story-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.meta-tag {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Story Color Themes */
.story-legenda-bradului .story-header {
    background: linear-gradient(135deg, #90ee90 0%, var(--legenda-bradului) 100%);
}

.story-capra-iezi .story-header {
    background: linear-gradient(135deg, #d2b48c 0%, var(--capra-iezi) 100%);
}

.story-gainusa-rosie .story-header {
    background: linear-gradient(135deg, #ffd700 0%, var(--gainusa-rosie) 100%);
}

.story-vulpea-barza .story-header {
    background: linear-gradient(135deg, var(--vulpea-barza) 0%, #4a90e2 100%);
}

.story-trei-ursi .story-header {
    background: linear-gradient(135deg, var(--trei-ursi) 0%, #ffb6c1 100%);
}

.story-trei-purcelusi .story-header {
    background: linear-gradient(135deg, #f7b799 0%, var(--trei-purcelusi) 100%);
}

.story-ridichea .story-header {
    background: linear-gradient(135deg, #a5d6a7 0%, var(--ridichea) 100%);
}

.story-punguta .story-header {
    background: linear-gradient(135deg, #ff8a65 0%, var(--punguta) 100%);
}

.story-iepure-testoasa .story-header {
    background: linear-gradient(135deg, #80deea 0%, var(--iepure-testoasa) 100%);
}

.story-ratusca .story-header {
    background: linear-gradient(135deg, #c5cae9 0%, var(--ratusca) 100%);
}

.story-scufita .story-header {
    background: linear-gradient(135deg, #ef9a9a 0%, var(--scufita) 100%);
}

.story-greierele .story-header {
    background: linear-gradient(135deg, #dce775 0%, var(--greierele) 100%);
}

.story-coliba .story-header {
    background: linear-gradient(135deg, #b3e5fc 0%, var(--coliba) 100%);
}

.story-ursul .story-header {
    background: linear-gradient(135deg, #bcaaa4 0%, var(--ursul) 100%);
}

.story-corbul .story-header {
    background: linear-gradient(135deg, #b0bec5 0%, var(--corbul) 100%);
}

.story-leul .story-header {
    background: linear-gradient(135deg, #ffe0b2 0%, var(--leul) 100%);
}

.story-ciorba .story-header {
    background: linear-gradient(135deg, #d7ccc8 0%, var(--ciorba) 100%);
}

.story-tapii .story-header {
    background: linear-gradient(135deg, #90caf9 0%, var(--tapii) 100%);
}

.story-broscuta .story-header {
    background: linear-gradient(135deg, #80cbc4 0%, var(--broscuta) 100%);
}

.story-anotimpuri .story-header {
    background: linear-gradient(135deg, #ffd54f 0%, var(--anotimpuri) 100%);
}

/* ========================================
   BADGES & LABELS
======================================== */
.badge-completed {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--success-color);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.5);
}

.badge-coming-soon {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--gradient-warning);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.5);
}

/* ========================================
   BUTTONS
======================================== */
.btn-primary-custom {
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    color: white;
}

.btn-secondary-custom {
    background: var(--gradient-success);
    border: none;
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.btn-secondary-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.6);
    color: white;
}

.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   NAVIGATION MENU (for story pages)
======================================== */
.nav-menu-story {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

/* Buton Acasă din meniul poveștii */
.nav-menu-home {
    background: rgba(255, 255, 255, 0.9);
}

.nav-menu-btn {
    background: rgba(255, 255, 255, 0.95);
    color: var(--gray-800);
    text-decoration: none;
    padding: 1rem 2.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 3px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu-btn:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
    color: var(--gray-800);
}

.nav-menu-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

/* ========================================
   FOOTER
======================================== */
.site-footer {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

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

.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: all var(--transition-base);
}

.footer-links a:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 35px rgba(102, 126, 234, 0.8);
    }
}

/* Stagger Animation for Cards */
.animate-stagger:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.1s both; }
.animate-stagger:nth-child(2) { animation: fadeInUp 0.6s ease-out 0.2s both; }
.animate-stagger:nth-child(3) { animation: fadeInUp 0.6s ease-out 0.3s both; }
.animate-stagger:nth-child(4) { animation: fadeInUp 0.6s ease-out 0.4s both; }
.animate-stagger:nth-child(5) { animation: fadeInUp 0.6s ease-out 0.5s both; }

/* ========================================
   UTILITIES
======================================== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: var(--shadow-lg);
}

.rounded-custom {
    border-radius: var(--radius-lg);
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 992px) {
    :root {
        --font-size-base: 15px;
    }
    
    .hero-section h2 {
        font-size: 2.5rem;
    }
    
    .story-icon {
        font-size: 5rem;
    }
}

@media (max-width: 768px) {
    :root {
        --font-size-base: 14px;
    }
    
    .logo-icon {
        font-size: 2.5rem;
    }
    
    .logo-text h1 {
        font-size: 1.5rem;
    }
    
    .hero-section h2 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1.2rem;
    }
    
    .story-header {
        height: 150px;
    }
    
    .story-icon {
        font-size: 4rem;
    }
    
    .story-title {
        font-size: 1.5rem;
    }
    
    .nav-menu-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .story-meta {
        flex-direction: column;
    }
    
    .meta-tag {
        text-align: center;
    }
    
    .nav-menu-story {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-menu-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   ACCESSIBILITY
======================================== */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   LOADING STATE
======================================== */
.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   FILTRE (pagina principală)
======================================== */
.filtre {
    background: rgba(255, 255, 255, 0.94);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filtru-grup {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filtru-eticheta {
    font-weight: 700;
    color: var(--gray-700);
    min-width: 4.5rem;
    font-size: 0.95rem;
}

.filtru-btn {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    padding: 0.4rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filtru-btn:hover {
    background: var(--gray-200);
}

.filtru-select {
    background: var(--gray-100);
    color: var(--gray-800);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-full);
    padding: 0.4rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    min-width: 14rem;
}

.filtru-select:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 1px;
}

.filtru-btn.activ {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.filtru-rezultat {
    color: #fff;
    font-weight: 600;
    min-height: 1.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Card de trimitere către Zona Educator */
.card-educator {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    text-align: left;
    color: var(--gray-800);
}

.card-educator h3 {
    color: var(--secondary-color);
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .site-header,
    .nav-menu-story,
    .site-footer,
    .filtre,
    .filtru-rezultat,
    .buton-mod-clasa,
    .buton-parcurs,
    .btn-primary-custom,
    .btn-secondary-custom {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .story-card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}
