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

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f5f5f5;
    --border-color: #ddd;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

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

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), #45a049);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

/* Hero Section */
.hero {
    background: white;
    color: var(--text-dark);
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
}

/* Upload Section */
.upload-section {
    padding: 3rem 0;
    background: var(--bg-light);
}

.upload-area {
    background: white;
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: #f0f8f0;
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-area h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.upload-area p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-large {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-primary:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-primary:disabled:hover {
    background: #cccccc;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #757575;
    color: white;
}

.btn-secondary:hover {
    background: #616161;
    transform: translateY(-2px);
}

.btn-secondary:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary:disabled:hover {
    background: #cccccc;
    transform: none;
}

.btn-success {
    background: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
}

.btn-success:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-large {
    background: var(--primary-color);
    color: white;
    font-size: 1.2rem;
    padding: 1rem 3rem;
}

.btn-large:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Controls */
.controls {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 0;
    box-shadow: var(--shadow);
}

.merge-options,
.format-options {
    margin-bottom: 1.5rem;
    text-align: center;
}

.merge-options label:first-child,
.format-options label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* Toggle Options Button */
.toggle-options-container {
    text-align: center;
    margin: 1.5rem 0;
}

.btn-toggle {
    background: #f5f5f5;
    color: var(--text-dark);
    padding: 0.6rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-toggle:hover {
    background: #e0e0e0;
    border-color: var(--primary-color);
}

/* Advanced Options */
.advanced-options {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    transition: all 0.3s;
}

.advanced-options.hidden {
    display: none;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-item label {
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    font-size: 0.9rem;
}

.option-item input[type="color"] {
    width: 50px;
    height: 35px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.option-item input[type="number"] {
    width: 70px;
    padding: 0.4rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.option-item input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.option-item .unit {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.radio-group {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#outputFormat {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    width: 200px;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

/* Preview Area */
.preview-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    min-height: 0;
    transition: all 0.3s ease;
}

.preview-item {
    background: white;
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: var(--shadow);
    cursor: grab;
    transition: all 0.3s;
    border: 2px solid transparent;
    width: 180px;
    flex-shrink: 0;
}

.preview-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.preview-item:active {
    cursor: grabbing;
}

.preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.preview-item .file-name {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-item .remove-btn {
    width: 100%;
    padding: 0.4rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.preview-item .remove-btn:hover {
    background: #d32f2f;
}

/* Download Section */
.download-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.download-section h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

#outputCanvas {
    margin: 1.5rem auto;
    display: block;
    border-radius: 8px;
}

.download-section button {
    margin: 0.5rem;
}

/* Content Sections */
.content-section,
.features-section,
.use-cases-section,
.faq-section,
.keywords-section {
    padding: 4rem 0;
}

.content-section h2,
.features-section h2,
.use-cases-section h2,
.faq-section h2,
.keywords-section h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

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

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), #45a049);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.step h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.step p {
    color: var(--text-light);
    line-height: 1.8;
}

.step ul {
    margin-top: 1rem;
    margin-left: 1.5rem;
    color: var(--text-light);
}

.step li {
    margin-bottom: 0.5rem;
}

/* Features Grid */
.features-section {
    background: var(--bg-light);
}

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

.feature {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s;
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.feature p {
    color: var(--text-light);
    line-height: 1.8;
}

/* Use Cases */
.use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.use-case {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.use-case:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.use-case h3 {
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.use-case p {
    color: var(--text-light);
    line-height: 1.8;
}

/* FAQ */
.faq-section {
    background: var(--bg-light);
}

.faq-list {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.faq-item:hover {
    box-shadow: var(--shadow-hover);
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.faq-item p {
    color: var(--text-light);
    line-height: 1.8;
}

/* Keywords Section */
.keywords-section {
    background: white;
    color: var(--text-dark);
}

.keywords-section h2 {
    color: var(--text-dark);
}

.keywords-intro,
.keywords-outro {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.keywords-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.keyword {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.3s;
    cursor: default;
    color: var(--text-dark);
}

.keyword:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color), #45a049);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p {
    opacity: 0.8;
    line-height: 1.8;
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        gap: 1rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .steps,
    .features-grid,
    .use-cases {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
        gap: 1rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }

    .content-section h2,
    .features-section h2,
    .use-cases-section h2,
    .faq-section h2,
    .keywords-section h2 {
        font-size: 1.8rem;
    }

    .cta-section h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .preview-item {
        width: 140px;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .btn-large {
        font-size: 1rem;
        padding: 0.8rem 2rem;
    }
}

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

.preview-item {
    animation: fadeIn 0.3s ease-in-out;
}

/* Drag and Drop Styling */
.preview-item.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    cursor: grabbing;
}

.preview-item.drag-over {
    border: 3px dashed var(--primary-color);
    background: rgba(76, 175, 80, 0.1);
    transform: scale(1.02);
}
