@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #111827;
    --surface: #1f2937;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border: #374151;
    --success: #10b981;
    --danger: #ef4444;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --transition: 0.2s ease-in-out;
}

[data-theme="light"] {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f9fafb;
    --surface: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; width: 100%; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-color); color: var(--text-main); line-height: 1.5; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.hidden { display: none !important; }
.active { display: block !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 500; border-radius: var(--radius-md); border: none; cursor: pointer; transition: var(--transition); }
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-outline { background-color: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-danger { background-color: #fee2e2; color: var(--danger); border: 1px solid #fecaca; }
.btn-block { width: 100%; }

/* Navigation */
.navbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.nav-content { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.25rem; font-weight: 700; color: var(--text-main); text-decoration: none; cursor: pointer; }
.logo i { font-size: 1.5rem; color: var(--primary); }
.nav-links { display: flex; gap: 1rem; }
.nav-btn { background: transparent; border: none; font-size: 0.95rem; font-weight: 500; color: var(--text-muted); cursor: pointer; padding: 0.5rem; transition: var(--transition); display: flex; align-items: center; gap: 0.4rem; text-decoration: none; }
.nav-btn:hover, .nav-btn.active { color: var(--primary); }

/* Main Container & Sections */
.main-container { padding: 2rem 1rem; min-height: calc(100vh - 70px); }
.view-section { display: none; }
.view-section.active { display: block; animation: smoothReveal 0.6s forwards; }
@keyframes smoothReveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Hero */
.hero { text-align: center; margin: 3rem 0; }
.hero-title { font-size: 3.5rem; font-weight: 800; background: linear-gradient(to right, #ffffff 0%, #c7d2fe 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 1.2rem; }
.hero-subtitle { font-size: 1.15rem; color: var(--text-muted); }

/* Tools Grid */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 3rem; }
.tool-card { background: var(--surface); border-radius: var(--radius-lg); padding: 2rem; border: 1px solid var(--border); transition: var(--transition); cursor: pointer; text-align: center; }
.tool-card:hover { transform: translateY(-5px); border-color: var(--primary); }
.tool-icon { font-size: 3rem; color: var(--primary); margin-bottom: 1.5rem; }

/* Workspace */
.section-header { text-align: center; margin-bottom: 2rem; }
.tool-workspace { display: flex; flex-direction: column; gap: 2rem; max-width: 1000px; margin: 0 auto; }
.upload-area { background: var(--surface); border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 4rem 2rem; text-align: center; cursor: pointer; transition: var(--transition); }
.upload-area:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.08); }
.upload-area i { font-size: 4rem; color: var(--text-muted); margin-bottom: 1rem; }

.workspace-content { display: grid; grid-template-columns: 1fr; gap: 2rem; background: var(--surface); padding: 2rem; border-radius: var(--radius-lg); border: 1px solid var(--border); }
@media (min-width: 768px) { .workspace-content { grid-template-columns: 300px 1fr; } .pdf-content { grid-template-columns: 1fr; } }

.controls-panel { display: flex; flex-direction: column; gap: 1.5rem; }
.control-group { display: flex; flex-direction: column; gap: 0.5rem; }
.preview-panel { display: flex; flex-direction: column; align-items: center; background: var(--bg-color); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; min-height: 300px; }

/* Stats */
.stats-panel { display: flex; flex-direction: column; gap: 0.75rem; background: var(--bg-color); padding: 1rem; border-radius: var(--radius-md); border: 1px solid var(--border); }
.stat-box { display: flex; justify-content: space-between; font-size: 0.9rem; }
.stat-box.accent .stat-value { color: var(--primary); }
.stat-box.success .stat-value { color: var(--success); }

/* Color Picker & Toggles */
.color-picker-grid { display: flex; gap: 0.75rem; }
.color-option { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.color-option.active { transform: scale(1.1); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }

.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border); transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

/* Misc */
#toast-container { position: fixed; bottom: 2rem; right: 2rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 9999; }
.toast { background: rgba(17, 24, 39, 0.9); color: white; padding: 0.85rem 1.8rem; border-radius: 50px; font-size: 0.9rem; border: 1px solid rgba(255,255,255,0.1); }
.ad-container { text-align: center; margin: 1.5rem auto; }
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3rem 1rem; margin-top: 4rem; text-align: center; }

@media (max-width: 768px) {
    .nav-links span { display: none; }
    .hero-title { font-size: 2rem; }
    .workspace-content { display: flex; flex-direction: column; }
    .preview-panel { order: -1; }
    .controls-panel { order: 1; }
}
