/* ========================================
   Hispanoteca - Spanish Literature Platform
   Ornate, Literary Design
======================================== */

:root {
    --primary-purple: #8b6ba8;
    --light-purple: #f3eff7;
    --accent-purple: #a78bbc;
    --dark-text: #2d2d2d;
    --muted-text: #6b6b6b;
    --border-ornate: #b89cd1;
    --cream-bg: #faf8f5;
    --white: #ffffff;
}

.btn-purple {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: #fff;
}
.btn-purple:hover {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: #fff;
}


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

body {
    font-family: 'Lora', 'Georgia', serif;
    color: var(--dark-text);
    background-color: var(--cream-bg);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ========================================
   Decorative Border Frame
======================================== */

.decorative-border-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.border-top-ornate,
.border-bottom-ornate,
.border-left-ornate,
.border-right-ornate {
    position: absolute;
    background: repeating-linear-gradient(
        90deg,
        var(--primary-purple) 0px,
        var(--accent-purple) 10px,
        var(--primary-purple) 20px,
        transparent 20px,
        transparent 30px
    );
}

.border-top-ornate {
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: url('data:image/svg+xml,<svg width="100" height="20" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="pattern-top" x="0" y="0" width="100" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="3" fill="%238b6ba8"/><path d="M25,5 Q30,0 35,5 T45,5" fill="none" stroke="%23a78bbc" stroke-width="1.5"/><circle cx="60" cy="10" r="2" fill="%23b89cd1"/><path d="M75,15 L78,10 L81,15 L78,12 Z" fill="%238b6ba8"/></pattern></defs><rect width="100" height="20" fill="url(%23pattern-top)"/></svg>') repeat-x;
}

.border-bottom-ornate {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: url('data:image/svg+xml,<svg width="100" height="20" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="pattern-bottom" x="0" y="0" width="100" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="3" fill="%238b6ba8"/><path d="M25,15 Q30,20 35,15 T45,15" fill="none" stroke="%23a78bbc" stroke-width="1.5"/><circle cx="60" cy="10" r="2" fill="%23b89cd1"/><path d="M75,5 L78,10 L81,5 L78,8 Z" fill="%238b6ba8"/></pattern></defs><rect width="100" height="20" fill="url(%23pattern-bottom)"/></svg>') repeat-x;
}

.border-left-ornate {
    top: 0;
    left: 0;
    width: 20px;
    height: 100%;
    background: url('data:image/svg+xml,<svg width="20" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="pattern-left" x="0" y="0" width="20" height="100" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="3" fill="%238b6ba8"/><path d="M5,25 Q0,30 5,35 T5,45" fill="none" stroke="%23a78bbc" stroke-width="1.5"/><circle cx="10" cy="60" r="2" fill="%23b89cd1"/><path d="M15,75 L10,78 L15,81 L12,78 Z" fill="%238b6ba8"/></pattern></defs><rect width="20" height="100" fill="url(%23pattern-left)"/></svg>') repeat-y;
}

.border-right-ornate {
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: url('data:image/svg+xml,<svg width="20" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="pattern-right" x="0" y="0" width="20" height="100" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="3" fill="%238b6ba8"/><path d="M15,25 Q20,30 15,35 T15,45" fill="none" stroke="%23a78bbc" stroke-width="1.5"/><circle cx="10" cy="60" r="2" fill="%23b89cd1"/><path d="M5,75 L10,78 L5,81 L8,78 Z" fill="%238b6ba8"/></pattern></defs><rect width="20" height="100" fill="url(%23pattern-right)"/></svg>') repeat-y;
}

/* Corner Ornaments */
.corner-ornament {
    position: absolute;
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
}

.corner-top-left {
    top: 0;
    left: 0;
    background-image: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><path d="M5,5 Q10,5 10,10 L10,50 Q10,55 15,55 L55,55" fill="none" stroke="%238b6ba8" stroke-width="2"/><circle cx="10" cy="10" r="4" fill="%23a78bbc"/><path d="M20,15 Q25,10 30,15 T40,15" fill="none" stroke="%23b89cd1" stroke-width="1.5"/><circle cx="15" cy="25" r="2" fill="%238b6ba8"/></svg>');
}

.corner-top-right {
    top: 0;
    right: 0;
    background-image: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><path d="M55,5 Q50,5 50,10 L50,50 Q50,55 45,55 L5,55" fill="none" stroke="%238b6ba8" stroke-width="2"/><circle cx="50" cy="10" r="4" fill="%23a78bbc"/><path d="M40,15 Q35,10 30,15 T20,15" fill="none" stroke="%23b89cd1" stroke-width="1.5"/><circle cx="45" cy="25" r="2" fill="%238b6ba8"/></svg>');
}

.corner-bottom-left {
    bottom: 0;
    left: 0;
    background-image: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><path d="M5,55 Q10,55 10,50 L10,10 Q10,5 15,5 L55,5" fill="none" stroke="%238b6ba8" stroke-width="2"/><circle cx="10" cy="50" r="4" fill="%23a78bbc"/><path d="M20,45 Q25,50 30,45 T40,45" fill="none" stroke="%23b89cd1" stroke-width="1.5"/><circle cx="15" cy="35" r="2" fill="%238b6ba8"/></svg>');
}

.corner-bottom-right {
    bottom: 0;
    right: 0;
    background-image: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><path d="M55,55 Q50,55 50,50 L50,10 Q50,5 45,5 L5,5" fill="none" stroke="%238b6ba8" stroke-width="2"/><circle cx="50" cy="50" r="4" fill="%23a78bbc"/><path d="M40,45 Q35,50 30,45 T20,45" fill="none" stroke="%23b89cd1" stroke-width="1.5"/><circle cx="45" cy="35" r="2" fill="%238b6ba8"/></svg>');
}

/* ========================================
   Content Wrapper
======================================== */

.content-wrapper {
    position: relative;
    background: var(--white);
    min-height: 100vh;
}

/* ========================================
   Header
======================================== */

.main-header {
    border-bottom: 3px solid var(--primary-purple);
    background: linear-gradient(to bottom, #ffffff 0%, #f8f6f9 100%);
    box-shadow: 0 2px 10px rgba(139, 107, 168, 0.15);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    filter: drop-shadow(0 2px 4px rgba(139, 107, 168, 0.3));
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-purple);
    letter-spacing: 0.5px;
}

.logo-link {
    text-decoration: none;
    transition: opacity 0.3s;
}

.logo-link:hover {
    opacity: 0.8;
}

/* Navigation */
.main-nav {
    display: grid;
    grid-template-columns: repeat(7, max-content);
    justify-content: center;
    gap: 8px 10px;
    padding-bottom: 8px;
}

.nav-link-ornate {
    font-family: 'Cormorant Garamond', serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-text);
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.3s;
    position: relative;
    white-space: nowrap;
    background: rgba(139, 107, 168, 0.05);
}

.nav-link-ornate:hover,
.nav-link-ornate.active {
    background: var(--primary-purple);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(139, 107, 168, 0.3);
}

.nav-link-ornate .nav-icon {
    font-size: 16px;
    font-weight: bold;
}

.icon-button {
    color: var(--primary-purple);
    transition: all 0.3s;
    display: inline-block;
    padding: 8px;
    border-radius: 50%;
    background: rgba(139, 107, 168, 0.1);
    position: relative;
}

.icon-button:hover {
    color: white;
    background: var(--primary-purple);
    transform: scale(1.1);
}

#themeButton {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(139, 107, 168, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(139, 107, 168, 0);
    }
}

/* ========================================
   Hero Section
======================================== */

.hero-hispanoteca {
    background: linear-gradient(135deg, var(--cream-bg) 0%, var(--light-purple) 100%);
    padding: 60px 0;
    position: relative;
}

.hero-hispanoteca::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="2" fill="%238b6ba8" opacity="0.1"/><circle cx="90" cy="90" r="2" fill="%238b6ba8" opacity="0.1"/></svg>') repeat;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    font-weight: 700;
    color: var(--dark-text);
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--muted-text);
    margin-bottom: 30px;
}

.btn-hero {
    background: var(--primary-purple);
    color: white;
    padding: 14px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(139, 107, 168, 0.3);
}

.btn-hero:hover {
    background: var(--accent-purple);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 107, 168, 0.4);
}

.hero-image-frame {
    position: relative;
    border-radius: 0 0 0 60px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.hero-main-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

/* ========================================
   Category Cards
======================================== */

.categories-section {
    padding: 50px 0;
    background: var(--light-purple);
}

.category-card-ornate {
    background: white;
    padding: 25px 15px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: all 0.3s;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-card-ornate:hover {
    transform: translateY(-5px);
    border-color: var(--primary-purple);
    box-shadow: 0 8px 20px rgba(139, 107, 168, 0.2);
}

.category-icon-ornate {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
}

.category-title-ornate {
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 6px;
}

.category-subtitle-ornate {
    font-size: 12px;
    color: var(--muted-text);
    margin: 0;
}

/* ========================================
   Content Boxes
======================================== */

.content-section {
    padding: 50px 0;
}

.content-box-ornate {
    background: white;
    border: 2px solid var(--light-purple);
    border-radius: 12px;
    padding: 30px;
    height: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.content-box-ornate:hover {
    box-shadow: 0 8px 25px rgba(139, 107, 168, 0.15);
    transform: translateY(-3px);
}

.content-header-ornate {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-purple);
}

.content-icon-ornate {
    font-size: 24px;
}

.content-header-ornate h5 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-purple);
    margin: 0;
}

/* Quote Box */
.quote-text-ornate {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-style: italic;
    color: var(--dark-text);
    line-height: 1.6;
    margin: 20px 0;
    padding-left: 20px;
    border-left: 4px solid var(--primary-purple);
}

.quote-author {
    font-size: 14px;
    color: var(--muted-text);
    text-align: right;
}

/* Featured Author */
.author-image-ornate {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.author-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-text);
}

.author-work {
    color: var(--primary-purple);
    font-style: italic;
    font-size: 15px;
}

.btn-outline-purple {
    border: 2px solid var(--primary-purple);
    color: var(--primary-purple);
    padding: 6px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
    transition: all 0.3s;
}

.btn-outline-purple:hover {
    background: var(--primary-purple);
    color: white;
}

/* Video Preview */
.video-preview-ornate {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.video-preview-ornate img {
    width: 100%;
    transition: transform 0.3s;
}

.video-preview-ornate:hover img {
    transform: scale(1.05);
}

/* ========================================
   Quiz Section
======================================== */

.quiz-section {
    padding: 50px 0;
    background: var(--light-purple);
}

.quiz-box-ornate {
    background: white;
    border: 2px solid var(--primary-purple);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(139, 107, 168, 0.2);
}

.quiz-question {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 20px;
}

.quiz-option {
    background: var(--light-purple);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

.quiz-option:hover {
    background: var(--primary-purple);
    color: white;
    border-color: var(--primary-purple);
}

.btn-quiz {
    background: var(--primary-purple);
    color: white;
    padding: 12px 40px;
    border-radius: 25px;
    text-decoration: none;
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s;
}

.btn-quiz:hover {
    background: var(--accent-purple);
    color: white;
    transform: scale(1.05);
}

/* ========================================
   Featured Books
======================================== */

.books-section {
    padding: 50px 0;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 30px;
}

.view-all-link {
    color: var(--primary-purple);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.view-all-link:hover {
    color: var(--accent-purple);
}

.book-card-ornate {
    text-align: center;
    transition: transform 0.3s;
}

.book-card-ornate:hover {
    transform: translateY(-10px);
}

.book-cover-ornate {
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    height: auto;
    transition: all 0.3s;
}

.book-cover-ornate:hover {
    box-shadow: 0 10px 30px rgba(139, 107, 168, 0.3);
}

/* ========================================
   Bottom Features
======================================== */

.bottom-features {
    padding: 40px 0;
    background: var(--light-purple);
    border-top: 2px solid var(--border-ornate);
}

.feature-link-ornate {
    text-decoration: none;
    display: block;
    text-align: center;
    padding: 20px 10px;
    border-radius: 10px;
    transition: all 0.3s;
}

.feature-link-ornate:hover {
    background: white;
    transform: translateY(-3px);
}

.feature-icon-large {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

.feature-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 5px;
}

.feature-desc {
    font-size: 11px;
    color: var(--muted-text);
    margin: 0;
}

/* ========================================
   Footer
======================================== */

.main-footer {
    background: linear-gradient(to bottom, var(--cream-bg) 0%, var(--light-purple) 100%);
    border-top: 2px solid var(--border-ornate);
}

.footer-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-purple);
    margin-bottom: 15px;
}

.footer-text {
    font-size: 14px;
    color: var(--muted-text);
    line-height: 1.6;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--muted-text);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-purple);
}

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

@media (max-width: 992px) {
    .main-nav {
        grid-template-columns: repeat(4, max-content);
        gap: 6px;
    }
    
    .nav-link-ornate {
        font-size: 12px;
        padding: 6px 8px;
        font-weight: 600;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .content-wrapper {
        margin: 20px;
    }
}

@media (max-width: 768px) {
    .main-nav {
        grid-template-columns: repeat(2, max-content);
        justify-content: center;
        gap: 5px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .content-wrapper {
        margin: 15px;
    }
    
    .border-top-ornate,
    .border-bottom-ornate {
        height: 15px;
    }
    
    .border-left-ornate,
    .border-right-ornate {
        width: 15px;
    }
    
    .corner-ornament {
        width: 40px;
        height: 40px;
    }
}

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

.text-purple {
    color: var(--primary-purple);
}

.bg-light-purple {
    background-color: var(--light-purple);
}

.divider-ornate {
    height: 2px;
    background: linear-gradient(to right, transparent, var(--primary-purple), transparent);
    margin: 30px 0;
}

/* ========================================
   Theme Switcher Modal
======================================== */

.theme-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.theme-modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    border: 3px solid var(--primary-purple);
}

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

.theme-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid var(--light-purple);
}

.theme-modal-header h5 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: var(--primary-purple);
    font-weight: 700;
}

.theme-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--muted-text);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.theme-close:hover {
    background: var(--light-purple);
    color: var(--primary-purple);
    transform: rotate(90deg);
}

.theme-modal-body {
    padding: 25px;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.theme-option {
    height: 100px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    padding: 15px;
    position: relative;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.theme-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: all 0.3s;
}

.theme-option:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

.theme-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.theme-option.active {
    border: 3px solid #fff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 0 4px var(--primary-purple);
}

.theme-option.active::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    color: var(--primary-purple);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-name {
    position: relative;
    z-index: 1;
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-family: 'Cormorant Garamond', serif;
}

/* Responsive theme modal */
@media (max-width: 768px) {
    .theme-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .theme-option {
        height: 80px;
    }
    
    .theme-modal-header h5 {
        font-size: 20px;
    }
}
