:root {
    --bg-color: #0f0c29;
    --surface-color: #1a1545;
    --text-primary: #f0eeff;
    --text-secondary: #b0aad4;
    --accent-color: #ff9900;
    --accent-hover: #cc7700;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --primary-gradient: linear-gradient(135deg, #ff9900, #cc7700);
}

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

body {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background animated orbs */
.hero-bg-orbs { position: absolute; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.35;
  animation: orb-float 8s ease-in-out infinite;
}
.orb1 { width: 400px; height: 400px; background: #7c3aed; top: -100px; left: -150px; animation-delay: 0s; }
.orb2 { width: 350px; height: 350px; background: #ff9900; top: 100px; right: -100px; animation-delay: 3s; }

@keyframes orb-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(15, 12, 41, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-main { display: contents; }
.header-controls { display: flex; gap: 1rem; align-items: center; order: 3; }
.logo {
    display: flex; align-items: center; gap: 0.5rem;
    font-weight: 800; font-size: 1.25rem; color: var(--accent-color); order: 1;
}
.logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }

.nav-links {
    display: flex; gap: 2rem; align-items: center;
    width: 100%; justify-content: center; order: 2;
}
.nav-links a {
    text-decoration: none; color: var(--text-secondary);
    font-weight: 500; transition: color 0.2s;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}
.nav-links a:hover { color: var(--text-primary); background: var(--glass-bg); }
.nav-links a.active { color: var(--accent-color); background: rgba(255, 153, 0, 0.12); font-weight: 600; }

.mobile-menu-btn {
    display: none; background: none; border: none;
    color: var(--text-primary); cursor: pointer; padding: 0.25rem;
}

/* Hero */
.hero { text-align: center; padding: 4rem 0 2rem; position: relative; z-index: 1;}
.hero h2 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-color), #ff6b6b, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}
.hero p { color: var(--text-secondary); font-size: 1.15rem; max-width: 600px; margin: 0 auto; }

/* Tool Box */
.tool-container {
    background: var(--surface-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}
.drop-zone:hover, .drop-zone.dragover {
    background: rgba(255, 153, 0, 0.06);
    border-color: var(--accent-color);
    transform: scale(1.01);
}
.upload-icon { width: 56px; height: 56px; color: var(--accent-color); margin-bottom: 1rem; }
.drop-content h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.drop-content p { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.95rem;}
.formats { font-size: 0.85rem; margin-top: 1.5rem; color: rgba(255, 255, 255, 0.5); }

/* Buttons */
.btn-primary {
    display: inline-block;
    background: var(--primary-gradient);
    color: #000;
    padding: 0.85rem 2.5rem;
    border-radius: 99px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(255, 153, 0, 0.4);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
}
.btn-primary:hover {
    transform: translateY(-2px) scale(1.02); 
    box-shadow: 0 8px 28px rgba(255, 153, 0, 0.5);
    filter: brightness(1.05);
}

/* Utility Button Colors */
.btn-success { background: #10b981 !important; color: white !important; }
.btn-success:hover { background: #059669 !important; }
.btn-warning { background: #f59e0b !important; color: white !important; }
.btn-warning:hover { background: #d97706 !important; }

/* Controls */
.controls-panel {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
    border: 1px solid var(--border-color);
}
.controls-panel.hidden, .hidden { display: none !important; }
.control-group { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; min-width: 200px; }
.control-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;}

select, input[type="range"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}
select:focus { border-color: var(--accent-color); background: rgba(255, 153, 0, 0.05); }
select option { background: #1a1545; }

/* Previews */
.preview-container { margin-top: 2rem; display: flex; flex-direction: column; gap: 1rem; }
.preview-item {
    display: flex; align-items: center; gap: 1.5rem; padding: 1rem;
    background: rgba(255,255,255,0.03); border-radius: 12px;
    border: 1px solid var(--border-color);
}
.preview-img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; background: rgba(0,0,0,0.2); }
.preview-info { flex: 1; min-width: 0; }
.preview-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.preview-stats { font-size: 0.85rem; color: var(--text-secondary); display: flex; gap: 1rem; flex-wrap: wrap; }
.savings { color: #10b981; font-weight: 700; }
.preview-actions { display: flex; align-items: center; gap: 0.75rem; }
.status-badge { font-size: 0.75rem; padding: 0.35rem 0.85rem; border-radius: 99px; font-weight: 700; letter-spacing: 0.5px; background: rgba(255,255,255,0.1); color: var(--text-primary); border: 1px solid transparent; }
.status-badge.success { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }

/* Form Elements */
.contact-form { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 2rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 0.35rem;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
}
.form-group input:focus, .form-group textarea:focus {
    border-color: var(--accent-color);
    background: rgba(255, 153, 0, 0.07);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.12);
}

/* Simple prose pages */
.prose {
    max-width: 800px;
    margin: 4rem auto;
    padding: 2.5rem;
    background: var(--surface-color);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}
.prose h1 { margin-bottom: 1.5rem; color: var(--accent-color); font-weight: 800; font-size: 2.5rem; letter-spacing: -1px;}
.prose h2 { margin: 2rem 0 1rem; font-weight: 700;}
.prose p { margin-bottom: 1.25rem; color: var(--text-secondary); line-height: 1.7; }

/* Ads */
.ad-slot { background: rgba(0,0,0,0.2); border: 1px dashed rgba(255,255,255,0.1); display: flex; justify-content: center; align-items: center; color: var(--text-secondary); font-size: 0.875rem; margin: 2rem auto; border-radius: 12px; }
.ad-header { width: 100%; max-width: 728px; height: 90px; }
.ad-incontent { width: 100%; max-width: 728px; height: 250px; }

/* Footer */
footer { border-top: 1px solid var(--border-color); padding: 2rem; margin-top: 4rem; text-align: center; color: var(--text-secondary); position: relative; z-index: 1; }
.footer-links { margin-top: 1rem; display: flex; justify-content: center; gap: 1.5rem; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-weight: 500;}
.footer-links a:hover { color: var(--text-primary); }

@media (max-width: 768px) {
    .app-header { flex-direction: column; padding: 1rem; }
    .header-main { display: flex; justify-content: space-between; align-items: center; width: 100%; }
    .mobile-menu-btn { display: block; }
    .nav-links { display: none; flex-direction: column; gap: 0; margin-top: 1rem; width: 100%; }
    .nav-links.active { display: flex; }
    .nav-links a { width: 100%; text-align: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border-color); }
    .preview-item { flex-direction: column; align-items: flex-start; }
    .hero h2 { font-size: 2rem; }
    .drop-zone { padding: 2rem 1rem; }
    .hero { padding: 2rem 0 1rem; }
    .preview-stats { flex-direction: column; gap: 0.25rem; }
    .prose { margin: 2rem auto; padding: 1.5rem; }
}


/* LIGHT MODE */
[data-theme="light"] {
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .app-header { background: rgba(255, 255, 255, 0.85);}
[data-theme="light"] .orb1 { background: #e0e7ff; opacity: 0.6; }
[data-theme="light"] .orb2 { background: #ffedd5; opacity: 0.6; }
[data-theme="light"] .hero h2 { background: linear-gradient(135deg, var(--accent-hover), #f43f5e, #7c3aed); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
[data-theme="light"] .controls-panel,
[data-theme="light"] .preview-item,
[data-theme="light"] .drop-zone,
[data-theme="light"] select,
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea,
[data-theme="light"] .ad-slot,
[data-theme="light"] .preview-img {
    background: #ffffff;
    border-color: #e2e8f0;
}
[data-theme="light"] select option { background: #ffffff; color: var(--text-primary); }
[data-theme="light"] .formats { color: var(--text-secondary); }

/* Toggle Button Styles */
#theme-toggle { background: none; border: none; color: var(--text-primary); cursor: pointer; display: flex; align-items: center; padding: 0.5rem; border-radius: 50%; transition: background 0.2s; margin-right: 0.5rem; }
#theme-toggle:hover { background: rgba(255, 255, 255, 0.1); }
[data-theme="light"] #theme-toggle:hover { background: rgba(0, 0, 0, 0.05); }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }