/* Scania Developer Portal - Light & Dark Theme */

/* ===== Dark Theme (default) ===== */
:root, [data-theme="dark"] {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2236;
    --bg-card-hover: #1e2a42;
    --bg-navbar: #0d1321;
    --border-color: #2a3550;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-cyan: #22d3ee;
    --accent-green: #22c55e;
    --accent-purple: #a78bfa;
    --badge-bg: rgba(59, 130, 246, 0.15);
    --badge-text: #60a5fa;
    --badge-status-bg: rgba(34, 197, 94, 0.15);
    --badge-status-text: #4ade80;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 30px rgba(59, 130, 246, 0.12);
    --hero-gradient-from: #60a5fa;
    --hero-gradient-to: #a78bfa;
    --icon-gradient-from: #1e3a5f;
    --icon-gradient-to: #2563eb;
}

/* ===== Light Theme ===== */
[data-theme="light"] {
    --bg-primary: #f0f4f8;
    --bg-secondary: #e2e8f0;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-navbar: #ffffff;
    --border-color: #d1d9e6;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --accent-cyan: #0891b2;
    --accent-green: #16a34a;
    --accent-purple: #7c3aed;
    --badge-bg: rgba(37, 99, 235, 0.1);
    --badge-text: #2563eb;
    --badge-status-bg: rgba(22, 163, 74, 0.1);
    --badge-status-text: #16a34a;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 8px 25px rgba(0, 0, 0, 0.1);
    --hero-gradient-from: #2563eb;
    --hero-gradient-to: #7c3aed;
    --icon-gradient-from: #1e40af;
    --icon-gradient-to: #3b82f6;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

main { flex: 1; }

a { color: var(--accent-blue); text-decoration: none; }
a:hover { color: var(--accent-cyan); }

/* Navbar */
.navbar {
    background: var(--bg-navbar) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem 0;
    transition: background-color 0.3s, border-color 0.3s;
}
.navbar-brand {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary) !important;
}
.navbar-brand img {
    height: 34px;
    width: 34px;
    object-fit: contain;
    border-radius: 4px;
}
.navbar-brand span {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: all 0.2s;
}
.theme-toggle:hover {
    background: var(--bg-card);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Language Switcher */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2px;
    font-size: 0.8rem;
    transition: background-color 0.3s, border-color 0.3s;
}
.lang-switch a {
    padding: 3px 10px;
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.lang-switch a.active,
.lang-switch a:hover {
    background: var(--accent-blue);
    color: white;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}
.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--hero-gradient-from), var(--hero-gradient-to));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}
.hero p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Product Cards */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--accent-blue);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2), 0 0 0 1px var(--accent-blue);
    background: var(--bg-card-hover);
}
.product-card:hover .product-logo img,
.product-card:hover .product-icon {
    transform: scale(1.12);
}
.product-logo img,
.product-icon {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-card:hover .card-title {
    color: var(--accent-blue);
    transition: color 0.3s;
}
.card-body { padding: 1.5rem; }
.card-footer {
    background: transparent !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 1rem 1.5rem;
}

.product-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--icon-gradient-from), var(--icon-gradient-to));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.product-icon-lg {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--icon-gradient-from), var(--icon-gradient-to));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

/* Product Logo (real images) */
.product-logo {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.product-logo img {
    max-width: 56px;
    max-height: 56px;
    object-fit: contain;
    border-radius: 10px;
}
.product-logo-lg {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.product-logo-lg img {
    max-width: 72px;
    max-height: 72px;
    object-fit: contain;
    border-radius: 12px;
}

.card-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.05rem;
}
.card-text {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Badges */
.badge-status {
    background: var(--badge-status-bg);
    color: var(--badge-status-text);
    font-weight: 500;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
}
.badge-category {
    background: var(--badge-bg);
    color: var(--badge-text);
    font-weight: 500;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Buttons */
.btn-primary {
    background: var(--accent-blue) !important;
    border-color: var(--accent-blue) !important;
    color: white !important;
}
.btn-primary:hover {
    background: var(--accent-blue-hover) !important;
    border-color: var(--accent-blue-hover) !important;
}
.btn-outline-primary {
    color: var(--accent-blue) !important;
    border-color: var(--border-color) !important;
    background: transparent !important;
}
.btn-outline-primary:hover {
    background: var(--badge-bg) !important;
    border-color: var(--accent-blue) !important;
    color: var(--accent-blue) !important;
}
.btn-outline-light {
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}
.btn-outline-light:hover {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Detail Page */
.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    transition: background-color 0.3s, border-color 0.3s;
}
.detail-card .card-header {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
}
.list-group-item {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary);
    transition: background-color 0.3s, border-color 0.3s;
}

/* Breadcrumb */
.breadcrumb { background: transparent; padding: 0; }
.breadcrumb-item a { color: var(--accent-blue); }
.breadcrumb-item.active { color: var(--text-secondary); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* Alert */
.alert {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
}
.alert-info { border-left: 3px solid var(--accent-blue); }
.alert-success { border-left: 3px solid var(--accent-green); }

/* Footer */
footer {
    background: var(--bg-navbar) !important;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted) !important;
    transition: background-color 0.3s, border-color 0.3s;
}

/* Empty State */
.empty-state { color: var(--text-muted); }
.empty-state i { color: var(--border-color); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

/* User Dropdown */
.user-dropdown {
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
    background: transparent !important;
}
.user-dropdown:hover {
    color: var(--text-primary) !important;
    background: var(--bg-card) !important;
}
.dropdown-menu {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.dropdown-item {
    color: var(--text-secondary) !important;
    font-size: 0.88rem;
    padding: 8px 16px;
}
.dropdown-item:hover {
    background: var(--bg-card-hover) !important;
    color: var(--text-primary) !important;
}
.dropdown-divider {
    border-color: var(--border-color) !important;
}

/* Admin Sidebar Nav */
.admin-nav .nav-link {
    color: var(--text-secondary) !important;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.88rem;
    margin-bottom: 2px;
    transition: all 0.2s;
}
.admin-nav .nav-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary) !important;
}
.admin-nav .nav-link.active {
    background: var(--badge-bg);
    color: var(--accent-blue) !important;
    font-weight: 600;
}

/* Admin Stats */
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Admin Table */
.admin-table {
    color: var(--text-primary);
}
.admin-table thead th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
}
.admin-table tbody td {
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
    font-size: 0.88rem;
    vertical-align: middle;
}
.admin-table tbody tr:hover {
    background: var(--bg-card-hover);
}

/* Admin Form Inputs */
.admin-input {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
.admin-input:focus {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}

/* Pagination */
.page-link {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}
.page-item.active .page-link {
    background: var(--accent-blue) !important;
    border-color: var(--accent-blue) !important;
    color: white !important;
}

/* User status badges */
.badge-locked {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 500;
}
.badge-active {
    background: var(--badge-status-bg);
    color: var(--badge-status-text);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 500;
}
.btn-outline-warning {
    color: #f59e0b !important;
    border-color: #f59e0b !important;
}
.btn-outline-warning:hover {
    background: rgba(245, 158, 11, 0.1) !important;
}
.btn-outline-danger {
    color: #ef4444 !important;
    border-color: #ef4444 !important;
}
.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

/* Product Description */
.product-description {
    font-size: 0.95rem;
    white-space: pre-line;
}

/* Product Tabs */
.product-tabs {
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
}
.product-tabs .nav-link {
    color: var(--text-muted) !important;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 500;
    background: transparent !important;
    transition: all 0.2s;
}
.product-tabs .nav-link:hover {
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color);
}
.product-tabs .nav-link.active {
    color: var(--accent-blue) !important;
    border-bottom-color: var(--accent-blue) !important;
    background: transparent !important;
}
