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

:root {
    --primary: #5E6AD2; --primary-hover: #4B55B0;
    --bg-color: #F2F4F8; --surface: #FFFFFF;
    --surface-glass: rgba(255, 255, 255, 0.75);
    --text-main: #1C1C1E; --text-muted: #8E8E93;
    --border: #E5E5EA; --input-bg: #FAFAFA; --input-focus: #FFFFFF;
    --danger: #FF3B30; --sidebar-width: 260px;
    --radius-xl: 28px; --radius-lg: 16px; --radius-md: 12px;
    --transition-fluid: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-theme {
    --bg-color: #121212; --surface: #1C1C1E;
    --surface-glass: rgba(28, 28, 30, 0.75);
    --text-main: #F2F2F7; --text-muted: #98989D;
    --border: #38383A; --input-bg: #2C2C2E; --input-focus: #3A3A3C;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-color); color: var(--text-main); min-height: 100vh; overflow-x: hidden; transition: background 0.3s; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }

#auth-card { width: 90%; max-width: 420px; padding: 40px; border-radius: var(--radius-xl); text-align: center; }
#app-layout { display: flex; width: 100%; min-height: 100vh; }

.sidebar { width: var(--sidebar-width); background: var(--surface); border-right: 1px solid var(--border); height: 100vh; position: fixed; top: 0; left: 0; display: flex; flex-direction: column; z-index: 100; transition: var(--transition-fluid); }
.sidebar-header { padding: 32px 24px; border-bottom: 1px solid var(--border); }
.sidebar-nav { padding: 24px 12px; display: flex; flex-direction: column; gap: 8px; }

.nav-item { background: transparent; color: var(--text-muted); padding: 14px 16px; border-radius: 100px; font-weight: 600; display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; transition: var(--transition-fluid); border: none; cursor: pointer; font-size: 0.95rem; }
.nav-item.active { background: rgba(94, 106, 210, 0.1); color: var(--primary); }
.nav-item:hover {
    background: var(--primary) !important;
    color: #FFFFFF !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(94, 106, 210, 0.3);
}

.main-content { margin-left: var(--sidebar-width); flex-grow: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 50; padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.glass-panel-header { background: var(--surface-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.content-wrapper { padding: 40px; max-width: 1000px; width: 100%; margin: 0 auto; }

.view-layer { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; width: 100%; height: 100vh; animation: fadeScale 0.5s var(--transition-fluid); z-index: 1000; }
@keyframes fadeScale { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

.card { background: var(--surface); border-radius: var(--radius-xl); padding: 32px; margin-bottom: 24px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.02); }
.card-title { font-size: 1.25rem; margin-bottom: 24px; color: var(--primary); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.input-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

input[type="text"], input[type="number"], input[type="date"], textarea, select {
    width: 100%; padding: 14px 16px; border-radius: var(--radius-md);
    border: 1px solid var(--border); background: var(--input-bg);
    color: var(--text-main); font-size: 1rem; transition: var(--transition-fluid);
    outline: none; -webkit-appearance: none; appearance: none;
}
input:focus, textarea:focus, select:focus {
    background: var(--input-focus); border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(94, 106, 210, 0.15);
}
input:disabled { opacity: 0.6; cursor: not-allowed; }
textarea { resize: vertical; min-height: 100px; }

button { background: var(--primary); color: white; border: none; padding: 14px 24px; border-radius: 100px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: var(--transition-fluid); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 8px 16px rgba(94, 106, 210, 0.2); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary { background: var(--input-bg); color: var(--text-main); border: 1px solid var(--border); }
button.secondary:hover:not(:disabled) { background: var(--border); transform: translateY(-2px); box-shadow: none; }
button.danger { background: var(--danger); color: white; }
button.primary-active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 12px rgba(94, 106, 210, 0.3); }

.icon-btn { padding: 10px; border-radius: 50%; width: 44px; height: 44px; }
.badge { background: white; color: var(--primary); padding: 2px 8px; border-radius: 100px; font-size: 0.8rem; font-weight: 700; margin-left: 4px; display: inline-block; }

/* Range Slider Styling */
input[type=range] { -webkit-appearance: none; background: transparent; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 24px; width: 24px; border-radius: 50%;
    background: var(--primary); cursor: pointer; margin-top: -8px; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 8px; cursor: pointer;
    background: rgba(150, 150, 150, 0.2); /* Transparent Track */
    border-radius: 4px;
}

.chip-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { background: rgba(94, 106, 210, 0.1); color: var(--primary); padding: 6px 14px; border-radius: 100px; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.review-item { background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px; position: relative; }
.remove-btn { position: absolute; top: 12px; right: 12px; background: var(--danger); color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; padding: 0; }

.file-drop { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 24px; text-align: center; color: var(--text-muted); cursor: pointer; transition: var(--transition-fluid); background: var(--input-bg); margin-bottom: 16px; font-size: 0.9rem; font-weight: 500; }
.file-drop:hover { border-color: var(--primary); background: rgba(94, 106, 210, 0.05); color: var(--primary); }
.preview-container { display: flex; flex-wrap: wrap; gap: 16px; padding-bottom: 8px; }
.preview-item { position: relative; display: inline-block; animation: scaleIn 0.3s ease; }
.img-preview { width: 100px; height: 100px; border-radius: var(--radius-md); object-fit: cover; box-shadow: 0 4px 12px rgba(0,0,0,0.1); background: var(--border); }
.remove-badge { position: absolute; top: -6px; right: -6px; background: var(--danger); color: white; border: none; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.2); z-index: 10; padding: 0; transition: transform 0.2s; }
.remove-badge:hover { transform: scale(1.15); }

#loader { position: fixed; inset: 0; background: var(--surface-glass); backdrop-filter: blur(10px); z-index: 20000; display: none; flex-direction: column; align-items: center; justify-content: center; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-100px); background: #34C759; color: white; padding: 12px 24px; border-radius: 100px; font-weight: 600; box-shadow: 0 8px 16px rgba(52, 199, 89, 0.25); transition: var(--transition-fluid); z-index: 30000; opacity: 0; }
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.fullscreen-modal { position: fixed !important; inset: 0 !important; width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; border-radius: 0 !important; }

/* --- FULL WIDTH PREVIEW OVERRIDES --- */
.content-wrapper { transition: max-width 0.4s var(--spring-easing), padding 0.4s ease; }

.content-wrapper.full-width {
    max-width: 100%;
    padding: 0;
}

.content-wrapper.full-width #preview-view {
    height: calc(100vh - 81px); /* Fill remaining height below topbar */
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    margin-top: 0;
}

#preview-view .preview-banner {
    position: absolute; top: 0; left: 0; width: 100%;
    background: var(--primary); color: white;
    padding: 8px; text-align: center;
    font-weight: 800; font-size: 0.85rem;
    z-index: 10; letter-spacing: 1px;
}