/* Onet Custom Styles */

:root {
    --onet-primary: #0d6efd;
    --onet-secondary: #6c757d;
    --onet-dark: #212529;
    --onet-brand-blue: #8ca5ad;
    --onet-brand-orange: #ff6b00;
}

body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Navbar */
.onet-navbar {
    background-color: #212529;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-link {
    font-weight: 500;
}

/* Brand Colors Override for Logo */
.navbar-brand .text-primary,
footer h5 .text-primary {
    color: var(--onet-brand-orange) !important;
}

.navbar-brand .text-info,
footer h5 .text-info {
    color: var(--onet-brand-blue) !important;
}

/* Theme toggle button */
#themeToggleBtn {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.75) !important;
    transition: color 0.2s;
}
#themeToggleBtn:hover {
    color: #fff !important;
}

/* Hero Section */
header {
    position: relative;
    overflow: hidden;
}

/* Feature Icons */
.icon-link {
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease-in-out;
}

.icon-link:hover {
    color: var(--onet-primary);
}

.icon-link i {
    transition: transform 0.2s ease-in-out;
}

.icon-link:hover i {
    transform: translateX(4px);
}

/* Card Hover Effects */
.card {
    transition:
        transform 0.2s ease-in-out,
        box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Pricing Card Specifics */
.pricing-card-title {
    color: var(--onet-dark);
}

/* Footer */
.onet-footer {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color) !important;
}

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

footer a:hover {
    color: var(--bs-emphasis-color) !important;
    text-decoration: underline;
}

/* Utility Classes */
.text-light-50 {
    color: rgba(255, 255, 255, 0.75);
}

/* Code blocks */
pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 0.375rem;
    border: 1px solid #444;
}

code {
    color: #e685b5;
}

/* ─── Dark Mode Overrides ──────────────────────────────────────────────── */

[data-bs-theme="dark"] {
    --bs-body-bg: #0d1117;
    --bs-body-color: #c9d1d9;
    --bs-border-color: #30363d;
    --bs-tertiary-bg: #161b22;
}

[data-bs-theme="dark"] .onet-navbar {
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
}

[data-bs-theme="dark"] .onet-footer {
    background-color: #0d1117;
    border-color: #30363d !important;
}

/* Cards */
[data-bs-theme="dark"] .card {
    background-color: #161b22;
    border-color: #30363d;
}

[data-bs-theme="dark"] .card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .card-header {
    background-color: #1c2128;
    border-color: #30363d;
}

[data-bs-theme="dark"] .card-footer {
    background-color: #1c2128;
    border-color: #30363d;
}

/* Tables */
[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    color: #c9d1d9;
}

[data-bs-theme="dark"] .table-dark {
    --bs-table-bg: #1c2128;
    color: #c9d1d9;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] .table-danger {
    --bs-table-bg: rgba(220, 53, 69, 0.15);
    color: #f8d7da;
}

[data-bs-theme="dark"] .table-warning {
    --bs-table-bg: rgba(255, 193, 7, 0.12);
    color: #fff3cd;
}

[data-bs-theme="dark"] .table-success {
    --bs-table-bg: rgba(25, 135, 84, 0.15);
    color: #d1e7dd;
}

/* Forms */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0d1117;
    border-color: #30363d;
    color: #c9d1d9;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0d1117;
    border-color: #58a6ff;
    color: #c9d1d9;
    box-shadow: 0 0 0 0.25rem rgba(88, 166, 255, 0.25);
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #6e7681;
}

[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-control[readonly] {
    background-color: #161b22;
    color: #8b949e;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #161b22;
    border-color: #30363d;
    color: #8b949e;
}

[data-bs-theme="dark"] .form-check-input {
    background-color: #0d1117;
    border-color: #30363d;
}

/* Modals */
[data-bs-theme="dark"] .modal-content {
    background-color: #161b22;
    border-color: #30363d;
}

[data-bs-theme="dark"] .modal-header {
    border-color: #30363d;
}

[data-bs-theme="dark"] .modal-footer {
    border-color: #30363d;
}

/* Dropdowns */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #161b22;
    border-color: #30363d;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #c9d1d9;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #1c2128;
    color: #f0f6fc;
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: #30363d;
}

/* Alerts */
[data-bs-theme="dark"] .alert-info {
    background-color: rgba(13, 202, 240, 0.12);
    border-color: rgba(13, 202, 240, 0.25);
    color: #9eeaf9;
}

[data-bs-theme="dark"] .alert-danger {
    background-color: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.25);
    color: #f8d7da;
}

[data-bs-theme="dark"] .alert-warning {
    background-color: rgba(255, 193, 7, 0.12);
    border-color: rgba(255, 193, 7, 0.25);
    color: #fff3cd;
}

[data-bs-theme="dark"] .alert-success {
    background-color: rgba(25, 135, 84, 0.12);
    border-color: rgba(25, 135, 84, 0.25);
    color: #d1e7dd;
}

/* Pagination */
[data-bs-theme="dark"] .page-link {
    background-color: #161b22;
    border-color: #30363d;
    color: #58a6ff;
}

[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

[data-bs-theme="dark"] .page-item.disabled .page-link {
    background-color: #0d1117;
    border-color: #30363d;
    color: #484f58;
}

/* List groups */
[data-bs-theme="dark"] .list-group-item {
    background-color: #161b22;
    border-color: #30363d;
    color: #c9d1d9;
}

/* Borders */
[data-bs-theme="dark"] .border {
    border-color: #30363d !important;
}

[data-bs-theme="dark"] .border-bottom {
    border-color: #30363d !important;
}

[data-bs-theme="dark"] .border-top {
    border-color: #30363d !important;
}

/* bg-light sections → adapt in dark mode */
[data-bs-theme="dark"] .bg-light {
    background-color: #161b22 !important;
    color: #c9d1d9;
}

/* bg-dark sections in landing pages → slightly lighter in dark mode to avoid blending */
[data-bs-theme="dark"] header.bg-dark,
[data-bs-theme="dark"] section.bg-dark {
    background-color: #1c2128 !important;
}

/* Badges */
[data-bs-theme="dark"] .badge.bg-light {
    background-color: #21262d !important;
    color: #c9d1d9 !important;
}

[data-bs-theme="dark"] .badge.bg-secondary {
    background-color: #30363d !important;
}

/* Pricing card title override */
[data-bs-theme="dark"] .pricing-card-title {
    color: #f0f6fc;
}

/* Code blocks stay dark in both modes */
[data-bs-theme="dark"] pre {
    background-color: #0d1117;
    border-color: #30363d;
}

[data-bs-theme="dark"] code {
    color: #d2a8ff;
}

/* Scrollbars (Webkit) */
[data-bs-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #0d1117;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* Selection highlight */
[data-bs-theme="dark"] ::selection {
    background-color: rgba(88, 166, 255, 0.3);
}

/* ─── Sidebar ───────────────────────────────────────────────────────── */

.onet-sidebar {
    width: 220px;
    background-color: #1c2128;
    border-right: 1px solid #30363d;
    color: #c9d1d9;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
}

.sidebar-brand {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #30363d;
    font-weight: 700;
    font-size: 1rem;
}

.sidebar-brand a {
    color: #e6edf3;
}

.sidebar-brand .text-primary {
    color: var(--onet-brand-orange) !important;
}

.sidebar-brand .text-info {
    color: var(--onet-brand-blue) !important;
}

.sidebar-nav {
    padding: 0.5rem 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.35rem 1rem;
    color: #8b949e;
    text-decoration: none;
    font-size: 0.825rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.15s, background-color 0.15s;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    margin-right: 0.6rem;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.sidebar-link:hover {
    color: #e6edf3;
    background-color: #21262d;
}

.sidebar-link.active {
    color: #58a6ff;
    background-color: rgba(88, 166, 255, 0.1);
}

.sidebar-section-label {
    padding: 0.6rem 1rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #484f58;
}

.sidebar-bottom {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #30363d;
    margin-top: auto;
}

.sidebar-user-link {
    color: #c9d1d9;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
}

.sidebar-user-link:hover {
    color: #e6edf3;
}

.sidebar-theme-btn {
    color: #8b949e !important;
    font-size: 0.9rem;
}

.sidebar-theme-btn:hover {
    color: #e6edf3 !important;
}

/* Main content area with sidebar */
.has-sidebar .main-content {
    overflow-y: auto;
    min-height: 100vh;
}

/* Mobile top bar */
.onet-mobile-topbar {
    background-color: #1c2128;
    border-bottom: 1px solid #30363d;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.onet-mobile-topbar .text-primary {
    color: var(--onet-brand-orange) !important;
}

.onet-mobile-topbar .text-info {
    color: var(--onet-brand-blue) !important;
}

/* Desktop: show sidebar as a static column */
@media (min-width: 992px) {
    .onet-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
    }
}

/* Mobile: offcanvas handles visibility */
@media (max-width: 991.98px) {
    .onet-sidebar {
        width: 260px;
    }
}

/* ─── Light mode sidebar overrides ─────────────────────────────────── */

[data-bs-theme="light"] .onet-sidebar {
    background-color: #f6f8fa;
    border-right-color: #d0d7de;
    color: #1f2328;
}

[data-bs-theme="light"] .sidebar-brand {
    border-bottom-color: #d0d7de;
}

[data-bs-theme="light"] .sidebar-brand a {
    color: #1f2328;
}

[data-bs-theme="light"] .sidebar-link {
    color: #656d76;
}

[data-bs-theme="light"] .sidebar-link:hover {
    color: #1f2328;
    background-color: #eaeef2;
}

[data-bs-theme="light"] .sidebar-link.active {
    color: #0969da;
    background-color: rgba(9, 105, 218, 0.08);
}

[data-bs-theme="light"] .sidebar-section-label {
    color: #8c959f;
}

[data-bs-theme="light"] .sidebar-bottom {
    border-top-color: #d0d7de;
}

[data-bs-theme="light"] .sidebar-user-link {
    color: #1f2328;
}

[data-bs-theme="light"] .sidebar-theme-btn {
    color: #656d76 !important;
}

[data-bs-theme="light"] .sidebar-theme-btn:hover {
    color: #1f2328 !important;
}

[data-bs-theme="light"] .onet-mobile-topbar {
    background-color: #f6f8fa;
    border-bottom-color: #d0d7de;
}

/* Smooth transitions for theme switch */
html {
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* ─── Mobile Responsive ─────────────────────────────────────────────── */

/* Tablet & below (≤991.98px) — sidebar touch targets */
@media (max-width: 991.98px) {
    .sidebar-link {
        padding: 0.5rem 1rem;
    }

    .sidebar-section-label {
        font-size: 0.7rem;
    }
}

/* Phone (≤767.98px) — typography, spacing, tables, modals */
@media (max-width: 767.98px) {
    /* Responsive typography */
    .display-4 { font-size: 2rem; }
    .display-5 { font-size: 1.75rem; }
    .display-6 { font-size: 1.5rem; }
    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.35rem; }
    .lead { font-size: 1rem; }

    /* Prevent iOS zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px;
    }

    /* Tighter container padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Touch-friendly action buttons */
    .btn-sm {
        min-width: 36px;
        min-height: 36px;
        padding: 0.375rem 0.5rem;
    }

    .btn-group .btn-sm {
        min-width: 36px;
        min-height: 36px;
    }

    /* Table improvements */
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 0.4rem 0.5rem;
        font-size: 0.825rem;
    }

    .table-responsive .table th:last-child,
    .table-responsive .table td:last-child {
        white-space: nowrap;
    }

    /* Near-fullscreen modals */
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }

    /* Page headers — stack title and action buttons */
    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    /* Dashboard toolbar wrap */
    .btn-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Card hover — disable transform on touch to avoid stuck states */
    .card:hover {
        transform: none;
    }
}
