/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #C62E2E;
    --secondary-color: #1e1e1e;
    --accent-color: #C1E172;
    --bg-color: #f8f9fa;
    --text-color: #1e1e1e;
    --text-muted: #6c757d;
    --white: #ffffff;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a32424 100%);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-icon {
    margin-top: 2rem;
}

/* Tool Section */
.tool-section {
    padding: 4rem 0;
}

.tool-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    margin-bottom: 2rem;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--text-muted);
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(198, 46, 46, 0.02);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(198, 46, 46, 0.05);
}

.upload-area h3 {
    font-size: 1.5rem;
    margin: 1rem 0 0.5rem;
    color: var(--text-color);
}

.upload-area p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.file-info {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--text-muted);
    background-color: var(--bg-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
}

/* Preview Section */
.preview-section h3,
.results-section h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: var(--border-radius-sm);
}

.preview-item canvas {
    border: 2px solid #ddd;
    border-radius: 4px;
    background: white;
    image-rendering: pixelated;
}

.preview-item span {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    padding: 0.875rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #a32424;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 2px solid var(--text-muted);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
}

/* Download Grid */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background-color: var(--bg-color);
    border: 2px solid #ddd;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    font-weight: 600;
}

.download-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(198, 46, 46, 0.05);
    transform: translateY(-2px);
}

.download-btn .icon {
    font-size: 1.5rem;
}

.btn-all {
    grid-column: 1 / -1;
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    justify-content: center;
}

.btn-all:hover {
    background-color: #a32424;
}

/* HTML Code Section */
.html-code {
    margin-top: 2rem;
}

.html-code h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.code-block {
    background-color: var(--secondary-color);
    border-radius: var(--border-radius-sm);
    padding: 1.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
}

.code-block code {
    color: var(--accent-color);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background-color: var(--white);
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2rem;
    border-radius: var(--border-radius);
    background-color: var(--bg-color);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* How to Use Section */
.how-to-use {
    padding: 4rem 0;
}

.how-to-use h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.step-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
}

.step-number {
    position: absolute;
    top: -20px;
    left: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.step-card h3 {
    font-size: 1.25rem;
    margin: 1rem 0 0.75rem;
}

.step-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a32424 100%);
    color: var(--white);
}

.cta-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.cta-text h2 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.cta-text p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.cta-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat strong {
    font-size: 2rem;
    font-weight: 700;
}

.stat span {
    font-size: 0.875rem;
    opacity: 0.9;
}

.cta-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Content Section */
.content-section {
    padding: 4rem 0;
    background-color: var(--white);
}

.content-article {
    max-width: 900px;
    margin: 0 auto;
}

.content-article h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.content-article h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--primary-color);
}

.content-article p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
}

.faq-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background-color: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.125rem;
    font-weight: 600;
    text-align: left;
    color: var(--text-color);
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--primary-color);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--primary-color);
    transition: var(--transition);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-muted);
    line-height: 1.8;
}

/* Footer */
.footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.25rem;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-column h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.footer-bottom p {
    margin: 0.25rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .tool-card {
        padding: 1.5rem;
    }

    .features h2,
    .how-to-use h2,
    .faq-section h2 {
        font-size: 2rem;
    }

    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }

    .cta-content {
        grid-template-columns: 1fr;
    }

    .cta-visual {
        display: none;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .download-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .tool-card {
        padding: 1rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }
}