/* ============================================
   LaTeX Templates Pro - Stylesheet
   ============================================ */

/* CSS Variables */
:root {
    --primary: #2C3E50;
    --primary-dark: #1a252f;
    --accent: #3498DB;
    --accent-dark: #2980B9;
    --success: #27AE60;
    --warning: #F39C12;
    --light: #F8F9FA;
    --dark: #343A40;
    --text: #333333;
    --text-light: #6C757D;
    --white: #FFFFFF;
    --border: #DEE2E6;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--accent-dark);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--accent-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-buy {
    background: var(--success);
    color: var(--white);
    font-size: 0.9rem;
    padding: 10px 20px;
}

.btn-buy:hover {
    background: #219a52;
    color: var(--white);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.logo:hover {
    color: var(--primary);
}

.logo-icon {
    color: var(--accent);
    font-size: 1.5rem;
}

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

.nav-links a {
    color: var(--text);
    font-weight: 500;
}

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

/* ============================================
   Hero Section
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 160px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(52, 152, 219, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(52, 152, 219, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

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

.hero-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 16px;
    opacity: 1;
}

.hero h1 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.85;
    max-width: 640px;
    margin: 0 auto 35px;
    line-height: 1.7;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.hero-features .feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    opacity: 0.9;
}

.hero-features .feature i {
    color: var(--accent);
    font-size: 0.85rem;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--white);
    color: var(--white);
}

/* ============================================
   Value Proposition Section
   ============================================ */
.value-prop-section {
    padding: 80px 0;
    background: var(--white);
}

.value-prop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.value-prop-item {
    text-align: center;
    padding: 30px 20px;
}

.value-prop-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.4rem;
    color: var(--white);
}

.value-prop-item h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.value-prop-item p {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.65;
    margin-bottom: 0;
}

/* ============================================
   How It Works Section
   ============================================ */
.how-it-works-section {
    padding: 80px 0;
    background: var(--light);
}

.steps-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.step-item {
    flex: 1;
    text-align: center;
    padding: 30px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.step-number {
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0 auto 16px;
}

.step-item h3 {
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.step-item p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.step-item code {
    background: var(--light);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
    color: var(--accent-dark);
}

.step-item a {
    font-weight: 500;
}

.step-connector {
    display: flex;
    align-items: center;
    padding-top: 50px;
    color: var(--border);
    font-size: 1.2rem;
}

/* ============================================
   Template Badges
   ============================================ */
.template-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.badge-popular {
    background: var(--warning);
    color: var(--white);
}

.badge-new {
    background: var(--success);
    color: var(--white);
}

.template-card {
    position: relative;
}

/* ============================================
   Filter Section
   ============================================ */
.filter-section {
    background: var(--light);
    padding: 20px 0;
    position: sticky;
    top: 60px;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.filter-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: var(--white);
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

/* ============================================
   Templates Grid
   ============================================ */
.templates-section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-top: -40px;
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* Template Card */
.template-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.template-card.hidden {
    display: none;
}

.template-preview {
    position: relative;
    height: 280px;
    background: var(--light);
    overflow: hidden;
}

.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: var(--transition);
}

.template-card:hover .template-preview img {
    transform: scale(1.05);
}

.preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.template-card:hover .preview-overlay {
    opacity: 1;
}

.preview-btn {
    padding: 12px 24px;
    background: var(--white);
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.template-info {
    padding: 25px;
}

.template-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent);
    color: var(--white);
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.template-info h3 {
    margin-bottom: 10px;
}

.template-info > p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.template-features {
    list-style: none;
    margin-bottom: 20px;
}

.template-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.template-features li i {
    color: var(--success);
    font-size: 0.75rem;
}

.template-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* ============================================
   Bundles Section
   ============================================ */
.bundles-section {
    background: var(--light);
    padding: 80px 0;
}

.bundles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.bundle-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    position: relative;
    transition: var(--transition);
}

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

.bundle-card.featured {
    border: 3px solid var(--accent);
}

.bundle-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--warning);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
}

.bundle-card.featured .bundle-badge {
    background: var(--accent);
}

.bundle-card h3 {
    margin-bottom: 10px;
}

.bundle-description {
    color: var(--text-light);
    margin-bottom: 20px;
}

.bundle-includes {
    list-style: none;
    margin-bottom: 25px;
}

.bundle-includes li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.bundle-includes li:last-child {
    border-bottom: none;
}

.bundle-includes li i {
    color: var(--success);
}

.bundle-pricing {
    text-align: center;
    margin-bottom: 20px;
}

.original-price {
    text-decoration: line-through;
    color: var(--text-light);
    margin-right: 10px;
}

.bundle-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

/* ============================================
   FAQ Section
   ============================================ */
.faq-section {
    padding: 80px 0;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.faq-item {
    padding: 25px;
    background: var(--light);
    border-radius: var(--radius);
}

.faq-item h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.faq-item h3 i {
    color: var(--accent);
}

.faq-item p {
    color: var(--text-light);
    margin-bottom: 0;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--primary);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo-icon,
.footer-brand .logo-text {
    color: var(--white);
}

.footer-brand p {
    opacity: 0.8;
    margin-top: 15px;
}

.footer h4 {
    color: var(--white);
    margin-bottom: 20px;
}

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

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

.footer-links a {
    color: var(--white);
    opacity: 0.8;
}

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

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.8;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: var(--white);
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-close:hover {
    color: var(--accent);
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-features {
        flex-direction: column;
        gap: 15px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .nav-links {
        display: none;
    }

    .templates-grid {
        grid-template-columns: 1fr;
    }

    .bundles-grid {
        grid-template-columns: 1fr;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .filter-bar {
        gap: 5px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .steps-grid {
        flex-direction: column;
        gap: 16px;
    }

    .step-connector {
        display: none;
    }

    .value-prop-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .template-footer {
        flex-direction: column;
        gap: 15px;
    }

    .template-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.template-card {
    animation: fadeIn 0.5s ease forwards;
}

.template-card:nth-child(2) { animation-delay: 0.1s; }
.template-card:nth-child(3) { animation-delay: 0.2s; }
.template-card:nth-child(4) { animation-delay: 0.3s; }
.template-card:nth-child(5) { animation-delay: 0.4s; }
.template-card:nth-child(6) { animation-delay: 0.5s; }
