/* home.css - Premium Mystic Style v4.0 (Cleaned & Refactored) */

/* === 1. ZMIENNE I BAZA === */
:root {
    --primary-gold: #d4af37;
    --primary-purple: #a855f7;
    --dark-bg: rgba(10, 5, 20, 0.95);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(20, 10, 35, 0.7);
    --text-main: #f0f0f0;
    --text-muted: #ccc;
    --container-width: 1100px;
}

body {
    font-family: 'Lato', sans-serif;
    color: var(--text-main);
    background: 
        radial-gradient(circle at 15% 20%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #0a0510 0%, #140a2e 100%);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, .section-title, .char-name, .fortune-title, .fortune-sub-title {
    font-family: 'Cinzel', serif;
}

/* Tło z gwiazdami */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-image: 
        radial-gradient(1px 1px at 50px 100px, white, transparent),
        radial-gradient(2px 2px at 250px 50px, white, transparent);
    background-size: 550px 550px;
    opacity: 0.5;
}

/* === 2. UKŁAD I KONTENERY === */
.homepage-container {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: var(--container-width);
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Główna karta (Glassmorphism) */
.main-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 50px;
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    margin-bottom: 60px;
}

/* Globalne style nagłówków sekcji */
.section-title {
    text-align: center;
    font-size: 1.8em;
    color: var(--primary-gold);
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
    width: 100%;
}

/* === 3. SEKCJA HERO (NAGŁÓWEK) === */
.homepage-hero {
    text-align: center;
    margin-bottom: 50px;
}
.homepage-h1 {
    font-size: 3em;
    background: linear-gradient(to right, #fff, var(--primary-gold), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    margin-bottom: 15px;
    line-height: 1.2;
}
.homepage-h2 {
    font-size: 1.2em;
    color: var(--text-muted);
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
}

/* === 4. MODUŁ POSTACI (GRID) === */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 20px;
}

.character-card {
    position: relative;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0,0,0,0.3);
    border: 1px solid transparent;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.char-img-wrapper {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    position: relative;
}

.char-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) sepia(20%) brightness(0.8);
    transition: all 0.5s ease;
    transform: scale(1.05);
}

.char-info {
    padding: 20px;
    text-align: center;
    background: linear-gradient(to top, rgba(0,0,0,0.95), rgba(0,0,0,0.6), transparent);
    position: absolute;
    bottom: 0;
    width: 100%;
    transform: translateY(15px);
    transition: transform 0.3s ease;
}

.char-name { font-size: 1.4em; color: #fff; margin: 0 0 5px 0; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.char-role { font-size: 0.8em; color: #ccc; text-transform: uppercase; letter-spacing: 1px; display: block; }

/* Interakcje Postaci */
.character-card:hover .char-img, .character-card.selected .char-img {
    filter: grayscale(0%) brightness(1.1);
    transform: scale(1.1);
}
.character-card:hover, .character-card.selected {
    border-color: var(--primary-gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.25);
    transform: translateY(-5px);
}
.character-card.selected .char-info { transform: translateY(0); }
.character-card.selected .char-name { color: var(--primary-gold); }
.characters-grid.has-selection .character-card:not(.selected) {
    opacity: 0.5; transform: scale(0.95); filter: blur(1px);
}

/* === 5. MODUŁ FORMULARZA === */
.form-section-hidden {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.8s ease-in-out;
}

/* FIX: ZWIĘKSZONA WYSOKOŚĆ I VISIBLE OVERFLOW */
.form-section-hidden.visible {
    max-height: 8000px; /* Wystarczająco dużo na każdą wróżbę */
    opacity: 1;
    margin-top: 50px;
    overflow: visible;
}

.form-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    position: relative;
}
.form-divider::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}
.divider-text {
    background: #140a23; 
    padding: 0 25px;
    color: #888;
    font-size: 0.9em;
    position: relative;
    z-index: 1;
    border-radius: 20px;
}

.mystic-form { max-width: 800px; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 25px; }
.form-group.full-width { grid-column: 1 / -1; }

.floating-label {
    display: block; margin-bottom: 10px; font-size: 0.85em;
    color: var(--primary-gold); text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
}

.form-input {
    width: 100%; padding: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff; font-family: 'Lato', sans-serif; font-size: 16px;
    transition: all 0.3s ease; box-sizing: border-box;
}
.form-input:focus {
    outline: none; background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-gold); box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

.submit-btn {
    width: 100%; padding: 22px;
    background: linear-gradient(135deg, #a855f7 0%, #701a75 100%);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    color: #fff; font-size: 1.1em; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px;
    cursor: pointer; transition: all 0.3s ease;
    margin-top: 30px; box-shadow: 0 10px 30px rgba(168, 85, 247, 0.3);
}
.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(168, 85, 247, 0.5); border-color: var(--primary-gold);
}

.pulsate { animation: pulse-glow 3s infinite; }
@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(168, 85, 247, 0); }
    100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}

.trust-badges {
    display: flex; justify-content: center; gap: 30px;
    margin-top: 25px; font-size: 0.8em; color: var(--text-muted);
}

/* === 6. WYNIK WRÓŻBY (NAPRAWIONE) === */
.loading-overlay { display: none; text-align: center; padding: 40px; }
.loading-text {
    font-family: 'Cinzel', serif; color: var(--primary-gold);
    margin-top: 20px; font-size: 1.3em; animation: fadeInOut 2s infinite;
}
@keyframes fadeInOut { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

/* Fix ramki */
.fortune-result {
    display: none;
    margin-top: 40px;
    padding: 40px;
    background: rgba(15, 10, 25, 0.85);
    border: 1px solid var(--primary-gold);
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s ease;
    
    /* Logika wysokości */
    height: auto;
    min-height: 200px;
    max-height: none; /* Brak limitu na desktopie */
    overflow: visible;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.fortune-title {
    color: var(--primary-gold); text-align: center; font-size: 2em;
    margin-bottom: 30px; text-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}
.fortune-text {
    line-height: 1.8; color: #e0e0e0; font-size: 1.1em;
    text-align: left; white-space: pre-wrap; word-wrap: break-word;
}
.fortune-sub-title {
    color: var(--primary-gold); font-family: 'Cinzel', serif; font-size: 1.4em;
    margin-top: 40px; margin-bottom: 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3); padding-bottom: 10px; letter-spacing: 1px;
}
.fortune-text strong.highlight { color: var(--primary-gold); font-weight: 700; }
.fortune-text br { display: block; margin-bottom: 10px; }

/* === 7. SEKCJA SEO === */
.home-seo-wrapper {
    margin: 0 auto 60px auto;
    width: 100%; max-width: var(--container-width);
    padding: 0 20px; box-sizing: border-box;
    display: flex; justify-content: center;
}

.home-seo-card {
    width: 100%; padding: 40px;
    background: var(--glass-bg); 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: 24px; border: 1px solid var(--glass-border);
    color: #ccc; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.seo-section h2 {
    color: var(--primary-gold); font-family: 'Cinzel', serif; font-size: 1.4em;
    margin-top: 30px; margin-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2); padding-bottom: 10px;
}

.show-more-btn {
    display: block; width: 100%; margin-top: 30px;
    background: transparent; border: 1px solid var(--primary-gold);
    color: var(--primary-gold); padding: 15px; border-radius: 50px;
    cursor: pointer; transition: 0.3s; text-transform: uppercase; letter-spacing: 1px;
}
.show-more-btn:hover { background: rgba(212, 175, 55, 0.1); }

/* === 8. MODUŁ HOROSKOPÓW (v3 - Ikony 100px) === */
.home-horoscopes-section {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto 60px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Wymuszenie stylu nagłówka w tej sekcji */
.home-horoscopes-section .section-title {
    margin-bottom: 40px; width: 100%; text-align: center;
}

.home-zodiac-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 50px; 
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.home-zodiac-item {
    display: flex; flex-direction: column; align-items: center;
    text-decoration: none; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.home-zodiac-item:hover { transform: translateY(-5px); }

/* Ikony Zodiaku */
.zodiac-circle {
    width: 100px; height: 100px;
    border-radius: 50%; overflow: hidden;
    border: 2px solid rgba(212, 175, 55, 0.3);
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    background: #000; position: relative;
}

.zodiac-circle img {
    width: 100%; height: 100%; object-fit: cover;
    filter: brightness(0.9) sepia(10%);
    transition: all 0.5s ease;
    display: block; /* Ważne! */
}

.home-zodiac-item:hover .zodiac-circle {
    border-color: var(--primary-gold);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.5);
}
.home-zodiac-item:hover .zodiac-circle img {
    filter: brightness(1.1) sepia(0%); transform: scale(1.1);
}

.zodiac-label {
    font-family: 'Cinzel', serif; font-size: 0.9rem;
    color: var(--text-muted); transition: 0.3s;
    text-transform: uppercase; letter-spacing: 1px;
}
.home-zodiac-item:hover .zodiac-label {
    color: #fff; text-shadow: 0 0 8px var(--primary-gold);
}

/* === 9. RESPONSYWNOŚĆ (MEDIA QUERIES) === */

/* Tablet */
@media (max-width: 1024px) {
    .home-zodiac-grid { grid-template-columns: repeat(4, 1fr); padding: 30px; }
}

/* Mobile */
@media (max-width: 768px) {
    .homepage-container { padding: 0 15px; }
    .main-card, .home-seo-card { padding: 25px 20px; }
    .characters-grid { grid-template-columns: 1fr; gap: 20px; }
    
    .char-img-wrapper { aspect-ratio: 16/9; background-position: center 20%; }
    .char-img { object-position: 50% 25%; }
    
    .form-grid { grid-template-columns: 1fr; }
    .homepage-h1 { font-size: 2em; }
    
    /* FIX DLA WRÓŻBY NA MOBILE - SCROLL */
    .fortune-result { 
        padding: 25px;
        max-height: 80vh; /* Ograniczenie wysokości tylko na telefonie */
        overflow-y: auto; /* Włączenie paska przewijania */
        -webkit-overflow-scrolling: touch;
    }
    
    .fortune-title { font-size: 1.5em; }
}

/* Small Mobile */
@media (max-width: 600px) {
    .home-zodiac-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px; padding: 20px;
    }
    .zodiac-circle { width: 70px; height: 70px; }
    .zodiac-label { font-size: 0.75rem; }
    .section-title { font-size: 1.4em; margin-bottom: 30px; }
}
/* --- SYSTEM OCENIANIA (RATING) --- */
.rating-container {
    margin-top: 30px;
    padding: 25px;
    /* ZMIANA: Jaśniejsze tło (z 0.4 na 0.15 + jaśniejszy kolor bazowy) */
    background: rgba(40, 35, 60, 0.85); 
    border: 1px solid rgba(199, 160, 85, 0.4);
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.5s ease-in-out;
    max-width: 600px; /* Ograniczenie szerokości */
    margin-left: auto;
    margin-right: auto;
}

.rating-title {
    font-family: 'Cinzel', serif;
    color: #f0e6d2; /* Jaśniejszy tekst */
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.rating-buttons-wrapper {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.rating-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.rating-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.rating-btn.positive:hover { border-color: #66bb6a; color: #66bb6a; }
.rating-btn.negative:hover { border-color: #ef5350; color: #ef5350; }

/* Formularz opinii - POPRAWA UKŁADU */
.feedback-form {
    margin-top: 20px;
    /* To jest kluczowe dla układu pionowego: */
    display: none; /* JS zmienia to na flex */
    flex-direction: column !important; 
    align-items: center;
    width: 100%;
}

.feedback-label {
    font-size: 0.95rem;
    color: #ccc;
    margin-bottom: 12px;
}

.feedback-textarea {
    width: 100%; /* Rozciągnij na całą szerokość kontenera */
    max-width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(199, 160, 85, 0.3);
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 15px; /* Odstęp pod polem tekstowym */
}

.feedback-textarea:focus {
    border-color: #c7a055;
    background: rgba(0, 0, 0, 0.5);
    outline: none;
}

.feedback-submit-btn {
    background: #c7a055;
    color: #1a1a1a;
    border: none;
    padding: 10px 40px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
    /* Upewniamy się, że przycisk nie rozciąga się na całą szerokość */
    align-self: center; 
}

.feedback-submit-btn:hover {
    background: #e6c67e;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(199, 160, 85, 0.4);
}

.rating-thank-you {
    color: #c7a055;
    font-weight: 600;
    margin-top: 15px;
    font-size: 1.1rem;
    display: none;
}