/* Global Design System - Soft/Lavish + Dark Mode */

:root {
    /* -------------------------------------
       Light Theme (Default / Soft / Lavish)
       ------------------------------------- */
    --bg-color: #f8faff;
    /* Very soft blue-white */
    --text-color: #334155;
    /* Slate 700 - Softer than black */
    --text-muted: #64748b;
    /* Slate 500 */
    --primary-color: #8b5cf6;
    /* Soft Violet */
    --primary-hover: #7c3aed;
    --secondary-color: #10b981;
    /* Emerald */
    --accent-color: #f472b6;
    /* Soft Pink */

    --card-bg: #ffffff;
    --card-border: rgba(226, 232, 240, 0.8);
    /* Slate 200 */
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    /* Soft shadow */

    --navbar-bg: rgba(255, 255, 255, 0.9);
    --navbar-border: rgba(226, 232, 240, 0.6);

    --input-bg: #f1f5f9;
    /* Slate 100 */
    --input-border: #cbd5e1;
    /* Slate 300 */

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* -------------------------------------
       Dark Theme (Deep / Contrast)
       ------------------------------------- */
    --bg-color: #0f172a;
    /* Slate 900 - Deep Navy */
    --text-color: #e2e8f0;
    /* Slate 200 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --primary-color: #a78bfa;
    /* Lighter Violet */
    --primary-hover: #8b5cf6;
    --secondary-color: #34d399;
    /* Lighter Emerald */
    --accent-color: #fbcfe8;
    /* Light Pink */

    --card-bg: #1e293b;
    /* Slate 800 */
    --card-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);

    --navbar-bg: rgba(15, 23, 42, 0.9);
    --navbar-border: rgba(255, 255, 255, 0.05);

    --input-bg: #334155;
    /* Slate 700 */
    --input-border: #475569;
    /* Slate 600 */
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    transition: background-color var(--transition), color var(--transition);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-color);
    /* Ensure headings use text-color, not white by default */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

button {
    cursor: pointer;
    font-family: var(--font-heading);
}

/* Layout */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--navbar-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color var(--transition), border-color var(--transition);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    /* Ensure brand is visible in both themes */
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--text-color);
    position: relative;
    padding: 0.5rem 0;
    opacity: 0.8;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    opacity: 1;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    /* Violet shadow */
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: #ffffff;
    /* White text on hover */
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.25rem;
    margin-left: 1rem;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition);
}

.theme-toggle:hover {
    background-color: var(--input-bg);
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
    /* Stronger shadow on hover */
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 0.9rem;
    background-color: var(--bg-color);
    /* Match body bg */
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-color);
    font-family: var(--font-body);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    /* Focus ring */
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.w-full {
    width: 100%;
}

/* Alerts / Flash Messages */
.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Dark Mode Overrides for Alerts */
[data-theme="dark"] .alert-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Dropdown Utilities */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 1rem;
    color: var(--text-color);
    text-align: left;
    list-style: none;
    background-color: var(--card-bg);
    background-clip: padding-box;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--card-shadow);
}

.dropdown-menu.show {
    display: block;
}