/*
 * Projeto Biker / SocialV - Identidade Asfalto + Petroleo + Ambar
 * Camada de tema isolada: carregada depois dos estilos originais do SocialV.
 */

:root,
[data-bs-theme="light"] {
    --moto-primary: #176B73;
    --moto-primary-dark: #103F46;
    --moto-accent: #E9A23B;
    --moto-asphalt: #171A1D;
    --moto-graphite: #23272B;
    --moto-concrete: #F4F5F3;
    --moto-white: #FFFFFF;
    --moto-text: #25282A;
    --moto-text-muted: #747A7E;
    --moto-success: #3D8C66;
    --moto-danger: #C84C44;
    --moto-border: #DDE1DF;
    --moto-primary-soft: #E8F2F2;
    --moto-accent-soft: #FFF4E3;
    --moto-success-soft: #E8F3ED;
    --moto-danger-soft: #F9EAE8;

    --bs-primary: var(--moto-primary);
    --bs-primary-rgb: 23, 107, 115;
    --bs-primary-text-emphasis: var(--moto-primary-dark);
    --bs-primary-bg-subtle: var(--moto-primary-soft);
    --bs-primary-border-subtle: #A9CED1;
    --bs-link-color: var(--moto-primary);
    --bs-link-color-rgb: 23, 107, 115;
    --bs-link-hover-color: var(--moto-primary-dark);
    --bs-link-hover-color-rgb: 16, 63, 70;

    --bs-warning: var(--moto-accent);
    --bs-warning-rgb: 233, 162, 59;
    --bs-warning-bg-subtle: var(--moto-accent-soft);
    --bs-warning-text-emphasis: #7A4B09;
    --bs-success: var(--moto-success);
    --bs-success-rgb: 61, 140, 102;
    --bs-success-bg-subtle: var(--moto-success-soft);
    --bs-danger: var(--moto-danger);
    --bs-danger-rgb: 200, 76, 68;
    --bs-danger-bg-subtle: var(--moto-danger-soft);

    --bs-body-color: var(--moto-text);
    --bs-body-color-rgb: 37, 40, 42;
    --bs-body-bg: var(--moto-concrete);
    --bs-body-bg-rgb: 244, 245, 243;
    --bs-heading-color: var(--moto-text);
    --bs-secondary-color: var(--moto-text-muted);
    --bs-secondary-color-rgb: 116, 122, 126;
    --bs-border-color: var(--moto-border);
    --bs-gray-900: var(--moto-white);
    --bs-gray-900-rgb: 255, 255, 255;
    --bs-focus-ring-color: rgba(23, 107, 115, .28);

    /* Compatibilidade com componentes proprios do projeto. */
    --biker-primary: var(--moto-primary);
    --biker-primary-hover: var(--moto-primary-dark);
    --biker-secondary: var(--moto-primary-dark);
    --biker-dark: var(--moto-asphalt);
    --biker-darker: #101214;
    --biker-bg: var(--moto-concrete);
    --biker-card-bg: var(--moto-white);
    --biker-text: var(--moto-text);
    --biker-text-muted: var(--moto-text-muted);
    --biker-border: var(--moto-border);
    --biker-success: var(--moto-success);
    --biker-warning: var(--moto-accent);
    --biker-danger: var(--moto-danger);
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

a,
.btn-link,
.nav-link:focus-visible {
    color: var(--moto-primary);
}

a:hover,
.btn-link:hover {
    color: var(--moto-primary-dark);
}

:focus-visible {
    outline: 2px solid var(--moto-accent);
    outline-offset: 2px;
}

.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--moto-primary);
    box-shadow: 0 0 0 .25rem rgba(23, 107, 115, .22);
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--moto-primary);
    --bs-btn-border-color: var(--moto-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--moto-primary-dark);
    --bs-btn-hover-border-color: var(--moto-primary-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #0C343A;
    --bs-btn-active-border-color: #0C343A;
    --bs-btn-disabled-bg: var(--moto-primary);
    --bs-btn-disabled-border-color: var(--moto-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--moto-primary);
    --bs-btn-border-color: var(--moto-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--moto-primary);
    --bs-btn-hover-border-color: var(--moto-primary);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--moto-primary-dark);
    --bs-btn-active-border-color: var(--moto-primary-dark);
}

.btn-warning {
    --bs-btn-color: var(--moto-asphalt);
    --bs-btn-bg: var(--moto-accent);
    --bs-btn-border-color: var(--moto-accent);
    --bs-btn-hover-color: var(--moto-asphalt);
    --bs-btn-hover-bg: #D99028;
    --bs-btn-hover-border-color: #D99028;
    --bs-btn-active-color: var(--moto-asphalt);
    --bs-btn-active-bg: #C9801F;
    --bs-btn-active-border-color: #C9801F;
}

.btn-success {
    --bs-btn-bg: var(--moto-success);
    --bs-btn-border-color: var(--moto-success);
    --bs-btn-hover-bg: #337957;
    --bs-btn-hover-border-color: #337957;
}

.btn-danger {
    --bs-btn-bg: var(--moto-danger);
    --bs-btn-border-color: var(--moto-danger);
    --bs-btn-hover-bg: #AD3E38;
    --bs-btn-hover-border-color: #AD3E38;
}

.bg-primary,
.badge.bg-primary,
.progress-bar,
.page-item.active .page-link {
    background-color: var(--moto-primary) !important;
}

.text-primary { color: var(--moto-primary) !important; }
.text-warning { color: #A36610 !important; }
.text-success { color: var(--moto-success) !important; }
.text-danger { color: var(--moto-danger) !important; }
.border-primary { border-color: var(--moto-primary) !important; }

.card,
.modal-content,
.offcanvas,
.list-group-item,
.dropdown-menu,
.toast,
.popover {
    background-color: var(--moto-white);
    border-color: var(--moto-border);
}

.card {
    box-shadow: 0 .4rem 1.5rem rgba(23, 26, 29, .055);
}

.dropdown-item,
.list-group-item-action,
.notification-item {
    color: var(--moto-text);
}

.dropdown-item:hover,
.dropdown-item:focus,
.list-group-item-action:hover,
.list-group-item-action:focus,
.notification-item:hover {
    color: var(--moto-primary-dark);
    background-color: var(--moto-primary-soft);
}

.dropdown-item.active,
.dropdown-item:active,
.list-group-item.active {
    color: #fff;
    background-color: var(--moto-primary);
    border-color: var(--moto-primary);
}

.form-control,
.form-select,
.input-group-text,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    color: var(--moto-text);
    background-color: var(--moto-white);
    border-color: var(--moto-border);
}

.form-control::placeholder { color: #90969A; }
.form-check-input:checked {
    background-color: var(--moto-primary);
    border-color: var(--moto-primary);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #fff;
    background-color: var(--moto-primary);
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus,
.nav-tabs .nav-link.active {
    color: var(--moto-primary);
    border-bottom-color: var(--moto-primary);
}

.page-link {
    color: var(--moto-primary);
    border-color: var(--moto-border);
}

.page-link:hover {
    color: var(--moto-primary-dark);
    background-color: var(--moto-primary-soft);
}

/* Sidebar SocialV */
.sidebar {
    background-color: var(--moto-asphalt);
    color: #DDE3E4;
}

.sidebar .sidebar-header { border-color: rgba(255, 255, 255, .09); }
.sidebar .navbar-brand .logo-title,
.sidebar .sidebar-base .nav-item .nav-link,
.sidebar .sidebar-base .nav-item .nav-link .icon,
.sidebar-base .nav-item .nav-link,
.sidebar-base .nav-item .nav-link .icon {
    color: #DDE3E4;
}

.sidebar.sidebar-default .nav-link:not(.static-item).active,
.sidebar.sidebar-default .nav-link:not(.static-item)[aria-expanded="true"] {
    background: var(--moto-primary);
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(23, 107, 115, .85);
}

.sidebar.sidebar-default .nav-link:not(.static-item):hover:not(.active):not([aria-expanded="true"]) {
    color: #fff;
    background: rgba(23, 107, 115, .26);
}

.sidebar.sidebar-default .nav-link:not(.static-item):hover:not(.active):not([aria-expanded="true"]) .icon {
    color: var(--moto-accent);
}

.sidebar .sidebar-toggle { background: var(--moto-graphite); }
.sidebar .sidebar-toggle .menu-btn i { color: var(--moto-accent); }

/* Topbar e menus de cabecalho */
.iq-navbar,
.iq-top-navbar,
.navbar.iq-navbar,
.header-nav {
    background-color: var(--moto-white) !important;
    border-bottom-color: var(--moto-border) !important;
}

.iq-navbar .nav-link:hover,
.iq-top-navbar .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--moto-primary);
}

.iq-sub-card:hover,
.iq-sub-card:focus-within {
    background-color: var(--moto-primary-soft);
}

.badge.bg-warning,
.notification-badge,
.iq-navbar .badge {
    color: var(--moto-asphalt);
    background-color: var(--moto-accent) !important;
}

.alert-primary {
    color: var(--moto-primary-dark);
    background-color: var(--moto-primary-soft);
    border-color: #A9CED1;
}

.alert-warning {
    color: #684006;
    background-color: var(--moto-accent-soft);
    border-color: #F2CD91;
}

.alert-success {
    color: #285F45;
    background-color: var(--moto-success-soft);
    border-color: #AED0BE;
}

.alert-danger {
    color: #7E2E29;
    background-color: var(--moto-danger-soft);
    border-color: #E7B3AF;
}

/* Destaques e componentes especificos do Biker. */
.card-biker-ride { border-left-color: var(--moto-primary); }
.card-biker-club { border-left-color: var(--moto-success); }
.card-biker-emergency { border-left-color: var(--moto-danger); }
.biker-nav-item:hover,
.biker-nav-item.active {
    color: var(--moto-primary);
    background-color: var(--moto-primary-soft);
}

/* Dark mode nativo do SocialV / Bootstrap. */
[data-bs-theme="dark"] {
    --bs-primary: #2C8991;
    --bs-primary-rgb: 44, 137, 145;
    --bs-primary-text-emphasis: #83C2C7;
    --bs-primary-bg-subtle: #13383C;
    --bs-primary-border-subtle: #245F65;
    --bs-link-color: #6AB1B7;
    --bs-link-color-rgb: 106, 177, 183;
    --bs-link-hover-color: #91CDD1;
    --bs-link-hover-color-rgb: 145, 205, 209;
    --bs-warning: var(--moto-accent);
    --bs-warning-rgb: 233, 162, 59;
    --bs-success: #61AA82;
    --bs-success-rgb: 97, 170, 130;
    --bs-danger: #DD756E;
    --bs-danger-rgb: 221, 117, 110;
    --bs-body-color: #E1E5E6;
    --bs-body-color-rgb: 225, 229, 230;
    --bs-body-bg: var(--moto-asphalt);
    --bs-body-bg-rgb: 23, 26, 29;
    --bs-heading-color: #FFFFFF;
    --bs-secondary-color: #AEB5B8;
    --bs-border-color: #3A4044;
    --bs-gray-900: var(--moto-graphite);
    --bs-gray-900-rgb: 35, 39, 43;
    --biker-bg: var(--moto-asphalt);
    --biker-card-bg: var(--moto-graphite);
    --biker-text: #E1E5E6;
    --biker-text-muted: #AEB5B8;
    --biker-border: #3A4044;
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .offcanvas,
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .list-group-item,
[data-bs-theme="dark"] .toast,
[data-bs-theme="dark"] .popover,
[data-bs-theme="dark"] .iq-navbar,
[data-bs-theme="dark"] .iq-top-navbar,
[data-bs-theme="dark"] .navbar.iq-navbar,
[data-bs-theme="dark"] .header-nav {
    color: #E1E5E6;
    background-color: var(--moto-graphite) !important;
    border-color: #3A4044;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text,
[data-bs-theme="dark"] .select2-container--default .select2-selection--single,
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple {
    color: #E1E5E6;
    background-color: #1D2124;
    border-color: #454C50;
}

[data-bs-theme="dark"] .dropdown-item,
[data-bs-theme="dark"] .list-group-item-action,
[data-bs-theme="dark"] .notification-item {
    color: #E1E5E6;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus,
[data-bs-theme="dark"] .list-group-item-action:hover,
[data-bs-theme="dark"] .notification-item:hover {
    color: #FFFFFF;
    background-color: #13383C;
}

[data-bs-theme="dark"] .text-muted { color: #AEB5B8 !important; }
[data-bs-theme="dark"] .bg-light { background-color: #2A2F33 !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
