/* 
 * Harry Potter House Quiz - Main Stylesheet
 * Enhanced for SEO and user experience
 * For harrypotterhousequiz.net
 */

/* ===== Base Styles ===== */
:root {
    /* House Colors */
    --gryffindor-primary: #740001;
    --gryffindor-secondary: #D3A625;
    --ravenclaw-primary: #0E1A40;
    --ravenclaw-secondary: #946B2D;
    --hufflepuff-primary: #372E29;
    --hufflepuff-secondary: #ECB939;
    --slytherin-primary: #1A472A;
    --slytherin-secondary: #AAAAAA;
    
    /* UI Colors */
    --background-color: #0E0E0E;
    --text-color: #F8F0E3;
    --parchment-color: #F8F0E3;
    --parchment-dark: #E8D8B7;
    --accent-color: #C19A49;
    --button-color: #8E793E;
    --button-hover: #AD9355;
}

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

body {
    font-family: 'EB Garamond', serif;
    color: var(--text-color);
    background-color: var(--background-color);
    background-image: url('../images/hogwarts-bg.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    line-height: 1.6;
    overflow-x: hidden;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel Decorative', cursive;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--button-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Navigation ===== */
.main-nav {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-right: 1rem;
}

.logo span {
    font-family: 'Cinzel Decorative', cursive;
    font-size: 1.2rem;
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--text-color);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* ===== Buttons ===== */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-family: 'Cinzel Decorative', cursive;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

.btn-primary {
    background-color: var(--button-color);
    color: var(--text-color);
}

.btn-primary:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

.btn-secondary:hover {
    background-color: rgba(142, 121, 62, 0.2);
    transform: translateY(-2px);
}

.btn-primary i, .btn-secondary i {
    margin-left: 0.5rem;
}

.btn-share {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--button-color);
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
}

.btn-share:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
}

/* ===== Sections ===== */
.section {
    padding: 4rem 0;
    border-bottom: 1px solid rgba(193, 154, 73, 0.3);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: var(--accent-color);
}

.section-description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.2rem;
}

/* ===== Welcome Screen ===== */
.hero-section {
    text-align: center;
    padding: 3rem 0;
}

.hogwarts-crest {
    margin-bottom: 2rem;
}

.hogwarts-crest img {
    max-width: 150px;
}

.main-title {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

.welcome-text {
    font-style: italic;
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: var(--accent-color);
}

.intro-text, .magic-text {
    max-width: 800px;
    margin: 0 auto 2rem;
    font-size: 1.2rem;
}

.video-section {
    margin-top: 4rem;
    text-align: center;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== Features Section ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* ===== Houses Section ===== */
.houses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.house-card {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.house-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
}

.house-card.gryffindor::before {
    background-color: var(--gryffindor-primary);
}

.house-card.ravenclaw::before {
    background-color: var(--ravenclaw-primary);
}

.house-card.hufflepuff::before {
    background-color: var(--hufflepuff-primary);
}

.house-card.slytherin::before {
    background-color: var(--slytherin-primary);
}

.house-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.house-image {
    margin-bottom: 1.5rem;
}

.house-image img {
    max-width: 120px;
}

.house-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.house-motto {
    font-style: italic;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.house-traits, .house-members {
    text-align: left;
    margin-bottom: 1.5rem;
}

.house-traits h4, .house-members h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.house-traits ul {
    list-style-position: inside;
    margin-bottom: 1rem;
}

.house-traits li {
    margin-bottom: 0.3rem;
}

/* ===== Quiz Preview Section ===== */
.quiz-preview-container {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 2rem;
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
}

.quiz-preview-question {
    margin-bottom: 2rem;
}

.quiz-preview-question h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.quiz-preview-options {
    margin-top: 1.5rem;
}

.preview-option {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.preview-option:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.option-letter {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background-color: var(--accent-color);
    color: var(--background-color);
    border-radius: 50%;
    margin-right: 1rem;
    font-weight: bold;
}

.option-text {
    flex: 1;
}

.quiz-cta {
    text-align: center;
    margin-top: 2rem;
}

/* ===== FAQs Section ===== */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(193, 154, 73, 0.3);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    cursor: pointer;
}

.faq-question h3 {
    margin-bottom: 0;
    font-size: 1.3rem;
}

.faq-toggle {
    font-size: 1.2rem;
    color: var(--accent-color);
    transition: transform 0.3s ease;
}

.faq-answer {
    padding: 0 0 1rem;
    display: none;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-item.active .faq-answer {
    display: block;
}

/* ===== Quiz Screen ===== */
.screen {
    display: none;
    min-height: 100vh;
    padding-top: 80px;
}

.screen.active {
    display: block;
}

.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
}

.sorting-hat {
    max-width: 150px;
    margin-bottom: 1rem;
}

.progress-container {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress {
    height: 100%;
    background-color: var(--accent-color);
    width: 0;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: right;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.question-container {
    max-width: 800px;
    margin: 0 auto 2rem;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 2rem;
    border-radius: 8px;
}

.question-container h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.options-container {
    margin-top: 2rem;
}

.option {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.option:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.option.selected {
    background-color: rgba(193, 154, 73, 0.3);
    border: 1px solid var(--accent-color);
}

.quiz-navigation {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
}

/* ===== User Info Screen ===== */
.parchment {
    background-color: var(--parchment-color);
    color: #333;
    padding: 3rem;
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    background-image: url('../images/parchment-texture.jpg');
    background-size: cover;
}

.parchment h2 {
    color: #5D4037;
    text-align: center;
    margin-bottom: 2rem;
}

.parchment p {
    color: #5D4037;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #5D4037;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #BDB76B;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.7);
    font-family: 'EB Garamond', serif;
    font-size: 1rem;
}

.form-help {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: #7D6E6A;
}

/* ===== Results Screen ===== */
.results-content {
    max-width: 800px;
    margin: 0 auto;
}

#house-announcement {
    text-align: center;
    margin-bottom: 3rem;
}

.sorting-hat-animation {
    margin: 2rem 0;
}

.sorting-hat-result {
    max-width: 150px;
    animation: hatBounce 2s ease-in-out;
}

@keyframes hatBounce {
    0% { transform: translateY(-50px); opacity: 0; }
    50% { transform: translateY(20px); opacity: 1; }
    75% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.house-reveal {
    margin-top: 2rem;
}

.house-reveal h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.house-name {
    font-size: 3rem;
    margin-bottom: 2rem;
    animation: revealText 1s ease-in-out;
}

@keyframes revealText {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.house-details {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 2rem;
    border-radius: 8px;
}

.house-crest {
    flex: 0 0 150px;
    text-align: center;
}

.house-crest img {
    max-width: 150px;
}

.house-description {
    flex: 1;
    min-width: 300px;
}

.house-description h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.house-traits {
    margin-top: 1.5rem;
}

.house-traits h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.house-traits ul {
    list-style-position: inside;
    margin-bottom: 1.5rem;
}

.house-stats {
    margin-top: 2rem;
}

.house-stats h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.stat-bars {
    margin-top: 1rem;
}

.stat-bar {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-label {
    width: 100px;
    font-weight: bold;
}

.stat-track {
    flex: 1;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
    margin: 0 1rem;
}

.stat-fill {
    height: 100%;
    animation: fillBar 1.5s ease-out;
}

@keyframes fillBar {
    0% { width: 0; }
}

.gryffindor-fill {
    background-color: var(--gryffindor-primary);
}

.ravenclaw-fill {
    background-color: var(--ravenclaw-primary);
}

.hufflepuff-fill {
    background-color: var(--hufflepuff-primary);
}

.slytherin-fill {
    background-color: var(--slytherin-primary);
}

.stat-percentage {
    width: 50px;
    text-align: right;
}

.acceptance-letter {
    text-align: center;
    margin-bottom: 3rem;
}

.letter-preview {
    max-width: 400px;
    margin: 2rem auto;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

.results-actions {
    text-align: center;
    margin-top: 2rem;
}

.share-buttons {
    margin-top: 2rem;
}

/* ===== Letter Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem 0;
}

.modal-content {
    background-color: var(--background-color);
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 8px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: var(--accent-color);
    cursor: pointer;
}

.letter-container {
    padding: 1rem;
}

.parchment-letter {
    background-color: var(--parchment-color);
    color: #333;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    background-image: url('../images/parchment-texture.jpg');
    background-size: cover;
}

/* ===== Footer ===== */
.site-footer {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 3rem;
}

.footer-logo {
    flex: 0 0 300px;
    margin-bottom: 2rem;
}

.footer-logo img {
    max-width: 80px;
    margin-bottom: 1rem;
}

.footer-logo h3 {
    font-size: 1.5rem;
}

.footer-links, .footer-social {
    flex: 0 0 200px;
    margin-bottom: 2rem;
}

.footer-links h4, .footer-social h4 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.social-icons {
    display: flex;
}

.social-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

/* ===== Responsive Styles ===== */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .nav-container {
        flex-direction: column;
    }
    
    .nav-links {
        margin-top: 1rem;
    }
    
    .nav-links li {
        margin-left: 1rem;
        margin-right: 1rem;
    }
    
    .house-details {
        flex-direction: column;
    }
    
    .house-crest {
        margin: 0 auto 2rem;
    }
    
    .parchment {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .welcome-text {
        font-size: 1.1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links li {
        margin: 0.5rem;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        margin-right: 0;
    }
    
    .quiz-navigation {
        flex-direction: column;
    }
    
    .quiz-navigation button {
        margin-bottom: 1rem;
    }
    
    .parchment {
        padding: 1.5rem;
    }
    
    .house-name {
        font-size: 2.2rem;
    }
}
