/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    background: var(--modal-bg, #1e293b);
    border: 1px solid var(--modal-border, #334155);
    border-radius: 16px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    z-index: 10001;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.modal-icon-error {
    color: #ef4444;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--modal-title, #f1f5f9);
    margin: 0;
    text-align: center;
}

.modal-message {
    font-size: 16px;
    line-height: 1.6;
    color: var(--modal-text, #cbd5e1);
    margin: 0 0 24px;
    text-align: center;
    white-space: pre-line;
}

.modal-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.modal-btn:active {
    transform: translateY(0);
}

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

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

/* Header controls container */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Theme switcher */
.theme-switcher {
    position: relative;
}

.theme-switcher-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: #cbd5e1;
}

.theme-switcher-btn:hover {
    background: rgba(71, 85, 105, 0.6);
    border-color: rgba(148, 163, 184, 0.4);
}

.theme-switcher-btn svg {
    width: 20px;
    height: 20px;
}

/* Light mode overrides - Enhanced UI Design */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-accent: #eff6ff;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #eff6ff;
    --modal-bg: #ffffff;
    --modal-border: #e2e8f0;
    --modal-title: #0f172a;
    --modal-text: #475569;
}

[data-theme="light"] body {
    background: #f8fafc;
    color: #0f172a;
}

[data-theme="light"] .page {
    background: transparent;
}

/* Cards and containers */
[data-theme="light"] .card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .side-card {
    background: #eff6ff;
    border-color: #dbeafe;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

[data-theme="light"] .converter-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .side-card h2,
[data-theme="light"] .side-card h3 {
    color: #0f172a;
}

[data-theme="light"] .side-card ul,
[data-theme="light"] .side-card ol {
    color: #475569;
}

[data-theme="light"] .side-card li {
    color: #475569;
}

[data-theme="light"] .side-card li strong {
    color: #1e40af;
    font-weight: 700;
}

[data-theme="light"] .side-card p {
    color: #475569;
}

/* Typography */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] .converter-header h1,
[data-theme="light"] .side-title {
    color: #0f172a;
}

[data-theme="light"] .subtitle,
[data-theme="light"] p,
[data-theme="light"] li {
    color: #475569;
}

/* Dropzone */
[data-theme="light"] .dropzone {
    background: #ffffff;
    border: 2px dashed #cbd5e1;
}

[data-theme="light"] .dropzone:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

[data-theme="light"] .dropzone.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
}

[data-theme="light"] .dropzone.file-selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

[data-theme="light"] .dropzone-title {
    color: #0f172a;
}

[data-theme="light"] .dropzone-sub {
    color: #64748b;
}

[data-theme="light"] .dropzone-icon {
    color: #3b82f6;
}

[data-theme="light"] .dropzone.error {
    border-color: #ef4444;
    background: #fef2f2;
}

[data-theme="light"] .dropzone.error .dropzone-title {
    color: #dc2626;
}

[data-theme="light"] .dropzone.error .dropzone-sub {
    color: #ef4444;
}

[data-theme="light"] .dropzone.error .dropzone-icon {
    color: #dc2626;
}

[data-theme="light"] .format-badge {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

[data-theme="light"] .dropzone::before {
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(59, 130, 246, 0.08) 0%, transparent 50%);
}

/* Buttons */
[data-theme="light"] .btn-convert,
[data-theme="light"] .btn-primary {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
}

[data-theme="light"] .btn-convert:hover,
[data-theme="light"] .btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

[data-theme="light"] .btn-download {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

[data-theme="light"] .btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

[data-theme="light"] .btn-secondary {
    background: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

/* Form controls */
[data-theme="light"] .tool-controls {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #dbeafe;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

[data-theme="light"] .control-label {
    color: #0f172a;
    font-weight: 600;
}

[data-theme="light"] .quality-value {
    color: #0f172a;
    font-weight: 700;
}

[data-theme="light"] .dimension-input,
[data-theme="light"] .format-select {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .dimension-input:focus,
[data-theme="light"] .format-select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Header controls */
[data-theme="light"] .theme-switcher-btn {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #475569;
}

[data-theme="light"] .theme-switcher-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .lang-dropdown-btn {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .lang-dropdown-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

[data-theme="light"] .lang-dropdown-menu {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .lang-dropdown-item {
    color: #475569;
    border-bottom-color: #f1f5f9;
}

[data-theme="light"] .lang-dropdown-item:hover {
    background: #f8fafc;
    color: #0f172a;
}

[data-theme="light"] .lang-dropdown-item.is-active {
    background: #eff6ff;
    color: #1e40af;
}

/* FAQ Section */
[data-theme="light"] .faq-section {
    background: transparent;
}

[data-theme="light"] .faq-container {
    background: #eff6ff;
    border-color: #bfdbfe;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
}

[data-theme="light"] .faq-item {
    background: #ffffff;
    border-color: #dbeafe;
}

[data-theme="light"] .faq-item:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

[data-theme="light"] .faq-question {
    color: #0f172a;
}

[data-theme="light"] .faq-question::before {
    background: #3b82f6;
    color: #ffffff;
}

[data-theme="light"] .faq-answer,
[data-theme="light"] .faq-answer p {
    color: #475569;
}

[data-theme="light"] .faq-title {
    color: #1e40af;
}

/* Footer and branding */
[data-theme="light"] .footer {
    color: #64748b;
}

[data-theme="light"] .brand-logo {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #e2e8f0;
}

[data-theme="light"] .brand-title {
    color: #0f172a;
}

[data-theme="light"] .brand-sub {
    color: #64748b;
}

/* Error messages */
[data-theme="light"] .error-banner {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* Converter specific */
[data-theme="light"] .converter-icon-badge {
    background: #3b82f6;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="light"] .feature-item {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

[data-theme="light"] .feature-item svg {
    color: #3b82f6;
}

[data-theme="light"] .hint {
    color: #64748b;
}

[data-theme="light"] .converter-features {
    color: #475569;
}

/* Tool pages and cards */
[data-theme="light"] .tools-section {
    background: transparent;
}

[data-theme="light"] .tool-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .tool-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.15);
}

[data-theme="light"] .tool-card-coming {
    background: #f1f5f9;
    border-color: #e2e8f0;
    opacity: 0.7;
}

[data-theme="light"] .tool-card-coming:hover {
    border-color: #cbd5e1;
    cursor: not-allowed;
}

[data-theme="light"] .tool-title {
    color: #0f172a;
}

[data-theme="light"] .tool-card-coming .tool-title {
    color: #94a3b8;
}

[data-theme="light"] .tool-description {
    color: #64748b;
}

[data-theme="light"] .tool-card-coming .tool-description {
    color: #cbd5e1;
}

[data-theme="light"] .tool-icon-wrapper {
    background: #eff6ff;
}

[data-theme="light"] .tool-card:hover .tool-icon-wrapper {
    background: #dbeafe;
}

[data-theme="light"] .tool-card-coming .tool-icon-wrapper {
    background: #f1f5f9;
}

[data-theme="light"] .tool-icon {
    color: #3b82f6;
}

[data-theme="light"] .tool-card-coming .tool-icon {
    color: #cbd5e1;
}

[data-theme="light"] .tool-badge {
    background: #10b981;
    color: #ffffff;
    border: none;
}

[data-theme="light"] .tool-badge-soon {
    background: #f1f5f9;
    color: #64748b;
    border: none;
}

[data-theme="light"] .tool-stat {
    color: #64748b;
}

[data-theme="light"] .tool-stat svg {
    color: #94a3b8;
}

[data-theme="light"] .tool-arrow {
    color: #cbd5e1;
}

[data-theme="light"] .tool-card:hover .tool-arrow {
    color: #3b82f6;
}

[data-theme="light"] .tool-card-coming .tool-arrow {
    color: #e2e8f0;
}

/* Hero section */
[data-theme="light"] .hero-section {
    background: transparent;
    padding: 80px 20px 60px;
}

[data-theme="light"] .hero-section::before {
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.12) 0%, rgba(147, 197, 253, 0.04) 40%, transparent 70%);
    opacity: 1;
}

[data-theme="light"] .hero-title {
    color: #0f172a;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
    font-weight: 800;
    text-shadow: 0 2px 20px rgba(59, 130, 246, 0.1);
}

[data-theme="light"] .hero-subtitle {
    color: #475569;
    font-size: 18px;
    font-weight: 400;
}

[data-theme="light"] .hero-badge {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

[data-theme="light"] .hero-badge svg {
    color: #ffffff;
}

/* Category sections - The most important part */
[data-theme="light"] .tool-category {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    margin-bottom: 24px;
}

[data-theme="light"] .tool-category:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .category-title {
    color: #0f172a;
    font-weight: 700;
}

[data-theme="light"] .category-icon {
    background: #eff6ff;
    border-color: #bfdbfe;
}

[data-theme="light"] .category-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

[data-theme="light"] .category-tools {
    gap: 4px;
}

[data-theme="light"] .category-tool-item {
    background: transparent;
    border: none;
    border-bottom: none;
    color: #475569;
    padding: 14px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
}

[data-theme="light"] .category-tool-item:last-child {
    margin-bottom: 0;
}

[data-theme="light"] .category-tool-item:hover {
    background: #f8fafc;
}

[data-theme="light"] .category-tool-active {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    padding-left: 13px;
}

[data-theme="light"] .category-tool-active:hover {
    background: #dbeafe;
}

[data-theme="light"] .category-tool-active .tool-item-name {
    color: #1e40af;
    font-weight: 600;
}

[data-theme="light"] .category-tool-disabled {
    background: #fafafa;
    opacity: 1;
    cursor: not-allowed;
}

[data-theme="light"] .category-tool-disabled:hover {
    background: #fafafa;
    transform: none;
}

[data-theme="light"] .category-tool-disabled .tool-item-name {
    color: #cbd5e1;
}

[data-theme="light"] .tool-item-badge {
    background: #10b981;
    color: #ffffff;
    border: none;
    font-weight: 600;
}

[data-theme="light"] .tool-item-badge-soon {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

[data-theme="light"] .tool-item-name {
    color: inherit;
}

[data-theme="light"] .tool-item-arrow {
    color: #cbd5e1;
    opacity: 0.6;
}

[data-theme="light"] .category-tool-active .tool-item-arrow {
    color: #3b82f6;
    opacity: 1;
}

[data-theme="light"] .category-tool-active:hover .tool-item-arrow {
    color: #2563eb;
}

[data-theme="light"] .category-tool-disabled .tool-item-arrow {
    display: none;
}

/* Section titles */
[data-theme="light"] .section-title,
[data-theme="light"] .section-title-main {
    color: #0f172a;
    font-weight: 800;
}

[data-theme="light"] .section-title-main::after {
    background: linear-gradient(90deg, transparent 0%, #3b82f6 50%, transparent 100%);
}

[data-theme="light"] .tools-section {
    margin-top: 40px;
    margin-bottom: 60px;
}

/* About section */
[data-theme="light"] .about-section {
    background: transparent;
    text-align: center;
}

[data-theme="light"] .about-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    text-align: center;
}

[data-theme="light"] .about-section .section-title {
    position: relative;
    display: inline-block;
    padding: 12px 32px;
    background: #3b82f6;
    color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
    margin: 0 0 32px 0;
    font-weight: 800;
}

[data-theme="light"] .about-section .section-title::before {
    content: '✨';
    margin-right: 8px;
}

[data-theme="light"] .about-section .section-title::after {
    display: none;
}

[data-theme="light"] .about-content {
    text-align: left;
}

[data-theme="light"] .about-container h2 {
    color: #0f172a;
}

[data-theme="light"] .about-subtitle {
    color: #0f172a;
    font-weight: 700;
}

[data-theme="light"] .about-content p {
    color: #475569;
}

[data-theme="light"] .about-features {
    color: #475569;
}

[data-theme="light"] .about-features li {
    color: #475569;
}

[data-theme="light"] .about-features li strong {
    color: #1e40af;
    font-weight: 700;
}

/* Articles */
[data-theme="light"] .articles-section {
    background: transparent;
}

[data-theme="light"] .article-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme="light"] .article-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

[data-theme="light"] .article-title {
    color: #0f172a;
}

[data-theme="light"] .article-excerpt {
    color: #64748b;
}

[data-theme="light"] .article-link {
    color: #3b82f6;
}

[data-theme="light"] .article-link:hover {
    color: #2563eb;
}

/* Slider and inputs */
[data-theme="light"] .quality-slider {
    background: #e2e8f0;
}

[data-theme="light"] .quality-slider::-webkit-slider-thumb {
    background: #3b82f6;
    border-color: #2563eb;
}

[data-theme="light"] .quality-slider::-moz-range-thumb {
    background: #3b82f6;
    border-color: #2563eb;
}

[data-theme="light"] .quality-value {
    color: #0f172a;
}

[data-theme="light"] .preset-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #475569;
}

[data-theme="light"] .preset-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

[data-theme="light"] .checkbox-label {
    color: #475569;
}

[data-theme="light"] input[type="checkbox"] {
    border-color: #cbd5e1;
}

[data-theme="light"] input[type="checkbox"]:checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

/* Preview section */
[data-theme="light"] .preview-section {
    background: #ffffff;
}

[data-theme="light"] .preview-header {
    color: #0f172a;
}

[data-theme="light"] .preview-stats {
    color: #475569;
}

[data-theme="light"] .preview-image {
    border-color: #e2e8f0;
}

/* Ad slots */
[data-theme="light"] .ad-slot {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme="light"] .ad-label {
    color: #94a3b8;
}

/* Additional converter elements */
[data-theme="light"] .converter-features {
    color: #475569;
}

[data-theme="light"] .layout {
    background: transparent;
}

/* Make sure all strong/bold text is readable */
[data-theme="light"] strong,
[data-theme="light"] b {
    color: #0f172a;
}

/* Links */
[data-theme="light"] a {
    color: #3b82f6;
}

[data-theme="light"] a:hover {
    color: #2563eb;
}

/* Tables if any */
[data-theme="light"] table {
    border-color: #e2e8f0;
}

[data-theme="light"] th {
    background: #f8fafc;
    color: #0f172a;
    border-color: #e2e8f0;
}

[data-theme="light"] td {
    color: #475569;
    border-color: #e2e8f0;
}

/* Code blocks if any */
[data-theme="light"] code,
[data-theme="light"] pre {
    background: #f8fafc;
    color: #0f172a;
    border-color: #e2e8f0;
}

/* Size comparison - Compress/Resize tools */
[data-theme="light"] .size-comparison {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme="light"] .size-label {
    color: #64748b;
}

[data-theme="light"] .size-value {
    color: #0f172a;
}

[data-theme="light"] .size-arrow {
    color: #3b82f6;
}

[data-theme="light"] .size-savings {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

[data-theme="light"] .dimension-label {
    color: #64748b;
}

[data-theme="light"] .dimension-value {
    color: #0f172a;
}
