/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    /* Colors */
    --primary-hue: 240;
    /* Blue/Purple base */
    --accent-color: linear-gradient(135deg, #00C6FF 0%, #0072FF 100%);
    --accent-glow: 0 0 20px rgba(0, 114, 255, 0.4);

    --bg-dark: #0f172a;
    --bg-gradient: radial-gradient(circle at 10% 20%, rgb(16, 23, 49) 0%, rgb(8, 11, 22) 90.2%);

    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.1);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    /* Spacing & Radius */
    --radius-lg: 24px;
    --radius-md: 12px;
    --radius-sm: 8px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    --font-main: 'Inter', sans-serif;
}

/* MINIMAL THEME OVERRIDES */
body.theme-minimal {
    --bg-gradient: #f8fafc;
    --glass-bg: #ffffff;
    --glass-border: #e2e8f0;
    --glass-highlight: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-color: #0f172a;
    --accent-glow: none;
    --radius-lg: 8px;
    --radius-md: 6px;
    --radius-sm: 4px;
}

body.theme-minimal::before,
body.theme-minimal::after {
    display: none;
}

body.theme-minimal .app-container {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    backdrop-filter: none;
    background: white;
}

body.theme-minimal .format-option.selected {
    background: #0f172a;
    color: white;
}

body.theme-minimal .format-option.selected span {
    color: white;
}

body.theme-minimal input,
body.theme-minimal select,
body.theme-minimal .icon-btn {
    color: #0f172a !important;
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}

body.theme-minimal .seo-section {
    background: white;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

body.theme-minimal details[open] summary {
    color: #0f172a;
}


/* CYBER THEME OVERRIDES */
body.theme-cyber {
    --bg-gradient: #000000;
    --glass-bg: rgba(0, 255, 65, 0.05);
    --glass-border: #00ff41;
    --glass-highlight: rgba(0, 255, 65, 0.1);
    --text-main: #00ff41;
    --text-muted: rgba(0, 255, 65, 0.7);
    --accent-color: #00ff41;
    --accent-glow: 0 0 10px #00ff41;
    --radius-lg: 0px;
    --radius-md: 0px;
    --radius-sm: 0px;
    --font-main: 'JetBrains Mono', monospace;
}

body.theme-cyber .app-container {
    border: 2px solid #00ff41;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
}

body.theme-cyber .btn-convert {
    color: black;
    font-weight: bold;
}

body.theme-cyber .format-option.selected {
    background: #00ff41;
}

body.theme-cyber .format-option.selected span,
body.theme-cyber .format-option.selected i {
    color: black !important;
}

body.theme-cyber *:not(.material-icons-round) {
    font-family: 'JetBrains Mono', monospace !important;
}

body.theme-cyber .seo-section {
    border: 1px solid #00ff41;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

body.theme-cyber details[open] summary {
    color: #00ff41;
    text-shadow: 0 0 5px #00ff41;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Changed for content flow */
    align-items: center;
    justify-content: flex-start;
    /* Changed for scrolling content */
    color: var(--text-main);
    overflow-x: hidden;
    position: relative;
    transition: background 0.5s ease;
    padding-top: 50px;
    padding-bottom: 50px;
}

/* Background Abstract Shapes */
body::before,
body::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
}

body::before {
    background: #4f46e5;
    top: -100px;
    left: -100px;
    animation: float 20s infinite alternate;
}

body::after {
    background: #0ea5e9;
    bottom: -100px;
    right: -100px;
    animation: float 25s infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.1);
    }
}

/* Glassmorphism Card */
.app-container {
    width: 90%;
    max-width: 1100px;
    min-height: 700px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: grid;
    grid-template-columns: 350px 1fr;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    margin-bottom: 50px;
    /* Space for SEO content */
}

/* Sidebar (Upload Area) */
.sidebar {
    background: rgba(0, 0, 0, 0.2);
    padding: 2rem;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.logo i {
    color: #38bdf8;
    font-size: 1.5rem;
}

body.theme-minimal .logo i {
    color: #0f172a;
}

body.theme-cyber .logo i {
    color: #00ff41;
}

/* Upload Zone */
.upload-zone {
    flex: 1;
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    transition: var(--transition-fast);
    cursor: pointer;
    background: var(--glass-bg);
}

.upload-zone:hover,
.upload-zone.drag-active {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.05);
}

body.theme-cyber .upload-zone:hover {
    border-color: #00ff41;
    background: rgba(0, 255, 65, 0.1);
}

body.theme-minimal .upload-zone:hover {
    border-color: #0f172a;
    background: #f1f5f9;
}


.upload-zone i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: var(--transition-fast);
}

.upload-zone:hover i {
    color: #38bdf8;
    transform: translateY(-5px);
}

body.theme-cyber .upload-zone:hover i {
    color: #00ff41;
}

body.theme-minimal .upload-zone:hover i {
    color: #0f172a;
}

.upload-zone h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.upload-zone p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.file-input {
    display: none;
}

/* Main Content Area */
.main-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
}

.section-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Grid Layouts */
.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
}

.format-option {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    user-select: none;
}

.format-option span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.format-option:hover {
    background: var(--glass-highlight);
    border-color: rgba(255, 255, 255, 0.2);
}

.format-option.selected {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
}

.format-option.selected span {
    color: #38bdf8;
}

/* Settings Controls */
.settings-group {
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-label {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Sliders */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 60%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

body.theme-minimal input[type="range"] {
    background: #e2e8f0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #38bdf8;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    transition: transform 0.1s;
}

body.theme-cyber input[type="range"]::-webkit-slider-thumb {
    background: #00ff41;
    box-shadow: 0 0 10px #00ff41;
    border-radius: 0;
}

body.theme-minimal input[type="range"]::-webkit-slider-thumb {
    background: #0f172a;
    box-shadow: none;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Switches */
.toggle-switch {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

body.theme-minimal .toggle-switch {
    background: #e2e8f0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.toggle-checkbox:checked+.toggle-switch {
    background: #38bdf8;
}

body.theme-cyber .toggle-checkbox:checked+.toggle-switch {
    background: #00ff41;
}

body.theme-minimal .toggle-checkbox:checked+.toggle-switch {
    background: #0f172a;
}

.toggle-checkbox:checked+.toggle-switch::after {
    transform: translateX(20px);
}

.toggle-checkbox {
    display: none;
}

/* Editor Components */
.editor-buttons {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    transform: translateY(-1px);
}

.icon-btn i {
    font-size: 1.2rem;
}

.styled-select,
.styled-input {
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: white;
    outline: none;
    font-family: inherit;
}

.styled-select option {
    background: #0f172a;
    color: white;
}

/* Action Bar */
.action-bar {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    /* Align badge */
    gap: 1rem;
    padding-top: 1rem;
}

.btn-convert {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.875rem 2.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--accent-glow);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-convert:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 114, 255, 0.6);
}

.btn-convert:active {
    transform: translateY(0);
}

/* Loading Animation */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

body.theme-cyber .spinner {
    border-color: rgba(0, 0, 0, 0.3);
    border-top-color: black;
}

.btn-convert.loading .spinner {
    display: block;
}

.btn-convert.loading span {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Size Estimation Badge */
.size-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid var(--glass-border);
}


/* SEO Content Styles */
.content-container {
    width: 90%;
    max-width: 1100px;
    margin-top: 0;
}

.seo-section {
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.seo-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #38bdf8;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.seo-section p {
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.feature-item i {
    font-size: 2.5rem;
    color: #818cf8;
}

/* FAQ Styles */
.seo-section details {
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

.seo-section details:last-child {
    border-bottom: none;
}

.seo-section summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 20px;
    color: var(--text-main);
}

.seo-section summary::after {
    content: '+';
    position: absolute;
    right: 0;
    color: var(--text-muted);
}

.seo-section details[open] summary::after {
    content: '-';
}

.seo-section details[open] summary {
    color: #38bdf8;
    margin-bottom: 1rem;
}


/* Mobile Responsive */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        min-height: auto;
        height: auto;
        width: 100vw;
        border-radius: 0;
        border: none;
    }

    .sidebar {
        padding: 1.5rem;
        flex: 0 0 auto;
        gap: 1rem;
    }

    .upload-zone {
        padding: 1.5rem;
        min-height: 150px;
    }

    .main-content {
        padding: 1.5rem;
        overflow-y: visible;
        flex: 1 1 auto;
    }
}

/* Footer */
.main-footer {
    width: 100%;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

.main-footer a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.main-footer a:hover {
    color: #818cf8;
    text-decoration: underline;
}

body.theme-cyber .main-footer a {
    color: #00ff41;
}

body.theme-minimal .main-footer {
    color: #64748b;
}

body.theme-minimal .main-footer a {
    color: #0f172a;
}