/* Modern SaaS Design System */
:root {
    --primary: #4F46E5;
    --primary-hover: #4338ca;
    --surface: #ffffff;
    --background: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --surface: #1e293b;
    --background: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background: var(--background); color: var(--text-main); line-height: 1.6; transition: background 0.3s, color 0.3s; }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--text-main); margin-bottom: 0.5rem; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }

/* Layout */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Navbar */
.navbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; backdrop-filter: blur(8px); background: rgba(var(--surface), 0.9); }
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
.nav-links { display: flex; gap: 1rem; align-items: center; }

/* Search */
.search-container { flex: 1; max-width: 500px; margin: 0 2rem; position: relative; }
.search-container input { width: 100%; padding: 0.75rem 1.25rem; border-radius: 99px; border: 1px solid var(--border); background: var(--background); color: var(--text-main); font-size: 0.95rem; outline: none; transition: all 0.2s; }
.search-container input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); }
.search-results-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-lg); margin-top: 0.5rem; display: none; z-index: 50; max-height: 300px; overflow-y: auto; }
.search-result-item { padding: 0.75rem 1.25rem; display: block; border-bottom: 1px solid var(--border); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--background); }

/* Hero */
.hero { background: linear-gradient(135deg, var(--background) 0%, rgba(79, 70, 229, 0.05) 100%); padding: 5rem 0; border-bottom: 1px solid var(--border); }
.hero h1 { font-size: 3.5rem; font-weight: 800; letter-spacing: -0.02em; }
.hero .subtitle { font-size: 1.25rem; color: var(--text-muted); max-width: 600px; margin: 0 auto; }

/* Cards & Grids */
.grid { display: grid; gap: 1.5rem; }
.cards-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.categories-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; }
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.card-body { padding: 1.5rem; }

/* Glassmorphism Panel */
.glass-panel { background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05); backdrop-filter: blur(4px); }

/* Calculator UI */
.calculator-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; }
@media(max-width: 900px) { .calculator-layout { grid-template-columns: 1fr; } }
.calc-grid { display: grid; gap: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-label { font-size: 0.9rem; font-weight: 500; color: var(--text-main); }
.form-control, .form-select { padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-main); font-size: 1rem; outline: none; transition: border-color 0.2s; width: 100%; }
.form-control:focus, .form-select:focus { border-color: var(--primary); }
.input-group { display: flex; }
.input-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none;}
.input-group-text { padding: 0.75rem 1rem; background: var(--background); border: 1px solid var(--border); border-top-right-radius: 8px; border-bottom-right-radius: 8px; color: var(--text-muted); font-size: 0.9rem; }

.result-box { background: linear-gradient(135deg, var(--primary) 0%, #3730a3 100%); color: white; border-radius: var(--radius); padding: 2rem; transition: all 0.3s; }
.result-box h4 { color: rgba(255,255,255,0.8); font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.display-4 { font-size: 2.5rem; font-weight: 700; }

/* Buttons & Pills */
.btn { padding: 0.6rem 1.25rem; border-radius: 8px; font-weight: 500; border: none; cursor: pointer; transition: all 0.2s; display: inline-block; text-align: center; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.875rem; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { border-color: var(--text-main); }
.btn-light { background: white; color: var(--primary); }
.btn-outline-light { background: transparent; border: 1px solid rgba(255,255,255,0.5); color: white; }
.btn-outline-light:hover { background: rgba(255,255,255,0.1); }
.btn-icon { background: transparent; font-size: 1.25rem; padding: 0.5rem; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: var(--background); }

.category-pill { display: inline-flex; align-items: center; justify-content: center; padding: 1rem 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-main); font-weight: 500; transition: all 0.2s; text-align: center; }
.category-pill:hover { border-color: var(--primary); color: var(--primary); background: rgba(79, 70, 229, 0.05); transform: translateY(-2px); }

/* Breadcrumb */
.breadcrumb { display: flex; list-style: none; gap: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.breadcrumb li+li::before { content: "›"; color: var(--text-muted); margin-right: 0.5rem; }
.breadcrumb .active { color: var(--text-main); font-weight: 500; }

/* Content Formatting */
.content-formatting h2 { margin-top: 2rem; }
.content-formatting p { margin-bottom: 1rem; color: var(--text-muted); }
.content-formatting ul { margin-bottom: 1rem; padding-left: 2rem; color: var(--text-muted); }

/* Utility */
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.w-100 { width: 100%; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.rounded-4 { border-radius: var(--radius); }
.fade-in { animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Admin Base Utilities */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.table-light { background: var(--background); }
.badge { padding: 0.25rem 0.5rem; border-radius: 99px; font-size: 0.75rem; font-weight: 600; }
.bg-success { background: #10b981; color: white; }
.bg-warning { background: #f59e0b; color: white; }
.bg-primary { background: var(--primary); color: white; }
.bg-dark { background: #1e293b; color: white; }
.form-text { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.text-danger { color: #ef4444; }
.alert-danger { background: #fee2e2; color: #991b1b; padding: 1rem; border-radius: 8px; border: 1px solid #fecaca; mb-3;}
