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

/* ==========================================================
   WisemanTech Design System & Bootstrap 5 Theme Overrides
   ========================================================== */

:root,
[data-bs-theme="dark"] {
    --bg-primary: #070d18;
    --bg-secondary: #0c1626;
    --panel-bg: rgba(16, 28, 46, 0.85);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-hover-border: rgba(124, 92, 255, 0.45);
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --brand-primary: #7c5cff;
    --brand-secondary: #3d8bfd;
    --brand-gradient: linear-gradient(135deg, #7c5cff 0%, #3d8bfd 100%);
    --brand-glow: rgba(124, 92, 255, 0.28);
    --accent-emerald: #10b981;
    --accent-danger: #ef4444;
    --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --card-hover-shadow: 0 25px 50px -12px rgba(124, 92, 255, 0.22);
    --nav-bg: rgba(7, 13, 24, 0.82);
    --input-bg: rgba(15, 23, 42, 0.75);
    --table-header-bg: rgba(15, 23, 42, 0.6);
}

[data-bs-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --panel-bg: rgba(255, 255, 255, 0.92);
    --panel-border: rgba(15, 23, 42, 0.1);
    --panel-hover-border: rgba(124, 92, 255, 0.5);
    --text-primary: #0f172a;
    --text-muted: #475569;
    --brand-primary: #6366f1;
    --brand-secondary: #2563eb;
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #2563eb 100%);
    --brand-glow: rgba(99, 102, 241, 0.15);
    --accent-emerald: #059669;
    --accent-danger: #dc2626;
    --card-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
    --card-hover-shadow: 0 20px 40px -15px rgba(99, 102, 241, 0.2);
    --nav-bg: rgba(248, 250, 252, 0.88);
    --input-bg: #ffffff;
    --table-header-bg: rgba(241, 245, 249, 0.8);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* ==========================================================
   Navigation & Header (Glassmorphism)
   ========================================================== */
.nav, .navbar-custom {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--panel-border);
    padding: 16px 0;
    transition: all 0.3s ease;
}

.brand {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-links a {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(124, 92, 255, 0.08);
}

/* ==========================================================
   Hero Section
   ========================================================== */
.hero {
    position: relative;
    min-height: 72vh;
    display: flex;
    align-items: center;
    padding: 80px 0;
    overflow: hidden;
    background: radial-gradient(circle at 85% 20%, var(--brand-glow), transparent 45%),
                radial-gradient(circle at 15% 80%, rgba(61, 139, 253, 0.12), transparent 40%);
}

.hero h1 {
    font-size: clamp(38px, 5.5vw, 64px);
    line-height: 1.08;
    margin: 14px 0 20px;
    font-weight: 800;
}

.hero p {
    color: var(--text-muted);
    font-size: 18px;
    max-width: 640px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--brand-primary);
    font-weight: 700;
    font-size: 11px;
    background: rgba(124, 92, 255, 0.12);
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(124, 92, 255, 0.25);
}

.hero-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--brand-gradient);
}

.hero-media-wrapper {
    position: relative;
    border-radius: 20px;
    padding: 6px;
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(6, 182, 212, 0.25));
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(124, 92, 255, 0.2);
    margin-bottom: 28px;
}

.floating-badge {
    position: absolute;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(13, 17, 26, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    animation: floatBob 4s ease-in-out infinite alternate;
}

@keyframes floatBob {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-8px); }
}

.floating-badge.badge-top-left {
    top: -16px;
    left: 20px;
}

.floating-badge.badge-bottom-right {
    bottom: -16px;
    right: 20px;
    animation-delay: -2s;
}

.hero-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 36px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-stat-item strong {
    display: block;
    font-size: 28px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.hero-stat-item span {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==========================================================
   Buttons & Interactive Elements
   ========================================================== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 12px 20px;
    background: rgba(124, 92, 255, 0.1);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(124, 92, 255, 0.35);
}

.button.primary {
    background: var(--brand-gradient);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(124, 92, 255, 0.35);
}

.button.primary:hover {
    box-shadow: 0 8px 25px rgba(124, 92, 255, 0.55);
}

.button.danger, .danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.25);
}

.button.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ffffff;
}

.link {
    background: none;
    border: 0;
    color: var(--brand-primary);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ==========================================================
   Cards, Panels & Marketplace Grid
   ========================================================== */
.panel, .card, .hero-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover, .project-card:hover {
    transform: translateY(-5px);
    border-color: var(--panel-hover-border);
    box-shadow: var(--card-hover-shadow);
}

.meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.badge {
    padding: 6px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 99px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
}

.price {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--accent-emerald);
    margin: 16px 0;
}

/* ==========================================================
   Form Controls
   ========================================================== */
input, select, textarea, .form-control, .form-select {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--panel-border) !important;
    border-radius: 12px !important;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus, .form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2) !important;
}

textarea {
    min-height: 100px;
}

/* ==========================================================
   Modals
   ========================================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: grid;
    place-items: center;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 20px;
}

.modal-card {
    position: relative;
    width: min(480px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.modal-card.wide {
    width: min(940px, 100%);
}

.close {
    position: absolute;
    right: 18px;
    top: 14px;
    background: none;
    border: 0;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

.stack {
    display: grid;
    gap: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid label {
    display: grid;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
}

.full {
    grid-column: 1 / -1;
}

.check {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.check input {
    width: 18px;
    height: 18px;
}

/* ==========================================================
   Admin Executive Portal
   ========================================================== */
.admin-body {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.admin-body:has(#adminSidebar.hidden) {
    grid-template-columns: 1fr;
}

.sidebar {
    padding: 28px 20px;
    border-right: 1px solid var(--panel-border);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-link {
    padding: 12px 16px;
    text-align: left;
    background: transparent;
    color: var(--text-muted);
    border: 0;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.side-link.active, .side-link:hover {
    background: rgba(124, 92, 255, 0.15);
    color: var(--text-primary);
}

.side-link.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.admin-main {
    padding: 36px 40px;
    overflow-y: auto;
}

.admin-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    gap: 20px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.max-w-md {
    max-width: 440px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.stat {
    position: relative;
    overflow: hidden;
    padding: 18px 20px;
}

.stat span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.stat strong {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 8px;
    display: block;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th, td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--panel-border);
    vertical-align: middle;
}

th {
    background: var(--table-header-bg);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

th:first-child { border-top-left-radius: 12px; }
th:last-child { border-top-right-radius: 12px; }

tr:hover td {
    background: rgba(124, 92, 255, 0.04);
}

.actions {
    display: flex;
    gap: 8px;
}

/* ==========================================================
   Theme Switcher Button
   ========================================================== */
.btn-theme-toggle {
    background: rgba(124, 92, 255, 0.12);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
    background: rgba(124, 92, 255, 0.25);
    transform: scale(1.05);
}

/* ==========================================================
   Responsive adjustments
   ========================================================== */
@media (max-width: 991.98px) {
    .hero {
        padding: 50px 0;
    }
    .admin-body {
        grid-template-columns: 1fr;
    }
    .sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
    }
    .admin-main {
        padding: 24px 20px;
    }
}
