:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #1f2937;
    --light-bg: #f8fafc;
    --border-color: #e5e7eb;
    --code-bg: #1e1e1e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    padding-top: 60px;
    color: #1f2937;
}

/* Back Button */
.back-button {
    position: fixed;
    top: 10px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.back-button:hover {
    background: white;
    transform: translateX(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Breadcrumb */
.breadcrumb-nav {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px 20px 5px;
}

.breadcrumb {
    list-style: none;
    display: flex;
    gap: 8px;
    font-size: 0.9rem;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumb a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
    color: white;
    font-weight: 600;
}

.container {
    max-width: 1000px;
    margin: 0 auto 40px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    animation: fadeInDown 0.5s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.converter-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-bottom: 30px;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.card-header {
    background: var(--dark-bg);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h2 {
    font-size: 1.5rem;
}

.mode-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
}

.mode-button {
    background: transparent;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.mode-button.active {
    background: var(--primary-color);
}

.card-body {
    padding: 30px;
}

.input-output-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .input-output-section {
        grid-template-columns: 1fr;
    }
}

.panel {
    display: flex;
    flex-direction: column;
    height: 400px;
}

.panel-header {
    padding: 15px 20px;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.panel-title {
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-actions {
    display: flex;
    gap: 10px;
}

.action-button {
    background: white;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.action-button:hover {
    background: #f3f4f6;
    border-color: var(--primary-color);
}

.textarea-container {
    flex: 1;
    position: relative;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

textarea {
    width: 100%;
    height: 100%;
    border: none;
    padding: 20px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    background: var(--light-bg);
}

.file-upload-section {
    margin-top: 20px;
    padding: 30px;
    background: var(--light-bg);
    border-radius: 8px;
    border: 2px dashed var(--border-color);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.file-upload-section:hover {
    border-color: var(--primary-color);
    background: #f3f4f6;
    transform: translateY(-2px);
}

.file-upload-section.dragover {
    border-color: var(--success-color);
    background: #ecfdf5;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.supported-formats {
    font-size: 0.82rem;
    color: #888;
    margin-top: 5px;
}

.browse-button {
    background: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
    font-weight: 600;
    pointer-events: none;
}

#fileInput {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.file-info {
    margin-top: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: none;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-info.show {
    display: block;
}

.file-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.file-name {
    font-weight: 600;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.controls-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.option-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.option-select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    background: white;
    transition: border-color 0.2s;
}

.option-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.primary-button {
    background: var(--primary-color);
    color: white;
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.primary-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.primary-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.secondary-button {
    background: white;
    color: var(--dark-bg);
    padding: 15px 25px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.secondary-button:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.secondary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 25px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-item {
    text-align: center;
    padding: 15px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 5px;
}

.message {
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
    display: none;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
}

.message.show {
    display: block;
}

.error-message {
    background: #fef2f2;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

.success-message {
    background: #f0fdf4;
    color: var(--success-color);
    border: 1px solid #bbf7d0;
}

.warning-message {
    background: #fffbeb;
    color: var(--warning-color);
    border: 1px solid #fed7aa;
}

.preview-section {
    margin-top: 20px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: none;
}

.preview-section.show {
    display: block;
}

.preview-content {
    text-align: center;
    padding: 20px;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    z-index: 10;
    font-weight: 500;
}

.copy-button:hover {
    background: rgba(102, 126, 234, 1);
    transform: scale(1.05);
}

.copy-button.copied {
    background: var(--success-color);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
    display: none;
}

.progress-bar.show {
    display: block;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.shortcuts-hint {
    margin-top: 15px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #6b7280;
    border: 1px solid var(--border-color);
}

.shortcuts-hint strong {
    color: #374151;
}

.kbd {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.85em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 30px;
    padding: 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.feature {
    text-align: center;
    padding: 15px;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.feature h4 {
    margin-bottom: 8px;
    font-size: 1rem;
    color: #1f2937;
}

.feature p {
    color: #6b7280;
    font-size: 0.9rem;
}

.seo-content {
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin-top: 30px;
}

.seo-content h2 {
    font-size: 1.3rem;
    color: #1f2937;
    margin: 20px 0 10px;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content p {
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 15px;
}

.seo-content ul {
    margin-left: 20px;
    color: #4b5563;
    line-height: 1.7;
}

.seo-content li {
    margin-bottom: 8px;
}

.faq-section {
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin-top: 30px;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #1f2937;
    font-size: 1.5rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.faq-item {
    background: var(--light-bg);
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.faq-item summary {
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    padding: 5px 0;
}

.faq-item summary:hover {
    color: var(--primary-color);
}

.faq-item p {
    margin-top: 10px;
    color: #4b5563;
    line-height: 1.6;
    font-size: 0.95rem;
}

.related-tools {
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin-top: 30px;
    text-align: center;
}

.related-tools h2 {
    margin-bottom: 20px;
    color: #1f2937;
    font-size: 1.4rem;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.related-link {
    display: inline-block;
    padding: 10px 20px;
    background: var(--light-bg);
    color: #1f2937;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.related-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.9;
    font-size: 0.9rem;
}

footer a {
    color: white;
    text-decoration: underline;
}

footer a:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {
    body {
        padding-top: 50px;
    }

    .back-button {
        top: 8px;
        left: 10px;
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .features {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .features {
        grid-template-columns: 1fr;
    }

    .related-links {
        flex-direction: column;
        align-items: stretch;
    }

    .related-link {
        text-align: center;
    }
}

/* Tool Switcher */
.tool-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 10px 16px;
    margin-bottom: 20px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.tool-switcher-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
    white-space: nowrap;
}

.tool-switch-btn {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-block;
}

.tool-switch-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.tool-switch-btn.active {
    background: white;
    color: #667eea;
    font-weight: 700;
    border-color: white;
    pointer-events: none;
}

@media (max-width: 600px) {
    .tool-switcher {
        gap: 6px;
        padding: 8px 12px;
    }

    .tool-switch-btn {
        font-size: 0.78rem;
        padding: 5px 10px;
    }
}