/* ===========================================
   Identidade Visual — Precificar Impressao 3D
   Marca: Recifemecatron
   =========================================== */

:root {
    --rm-orange: #eb9400;
    --rm-navy: #1c2c3b;
    --rm-teal: #00d8bb;
    --rm-light: #f9f9f9;
    --rm-orange-hover: #d08500;
    --rm-teal-hover: #00c0a6;
}

/* Tipografia global */
body {
    font-family: 'Poppins', sans-serif;
}

/* Navbar — azul marinho da marca */
.navbar-brand-rm {
    background-color: var(--rm-navy) !important;
}

/* Botao primario — laranja da marca */
.btn-primary {
    --bs-btn-bg: var(--rm-orange);
    --bs-btn-border-color: var(--rm-orange);
    --bs-btn-hover-bg: var(--rm-orange-hover);
    --bs-btn-hover-border-color: var(--rm-orange-hover);
    --bs-btn-active-bg: var(--rm-orange-hover);
    --bs-btn-active-border-color: var(--rm-orange-hover);
    --bs-btn-disabled-bg: var(--rm-orange);
    --bs-btn-disabled-border-color: var(--rm-orange);
}

/* Links */
a {
    color: var(--rm-orange);
}
a:hover {
    color: var(--rm-orange-hover);
}

/* Navbar links — manter branco para contraste */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.75);
}
.navbar-dark .navbar-nav .nav-link:hover {
    color: #ffffff;
}
.navbar-dark .navbar-nav .nav-link.active {
    color: var(--rm-orange) !important;
}
.navbar-dark .navbar-brand {
    color: #ffffff;
}
.navbar-dark .navbar-brand:hover {
    color: var(--rm-orange);
}

/* Dropdown items */
.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--rm-orange);
}

/* Spinner de carregamento */
.spinner-border.text-primary {
    color: var(--rm-orange) !important;
}

/* Footer */
.footer-rm {
    background-color: var(--rm-navy) !important;
    color: rgba(255, 255, 255, 0.5);
}

/* Toggle theme button hover */
.btn-outline-light:hover {
    background-color: var(--rm-orange) !important;
    border-color: var(--rm-orange) !important;
}

/* Dark mode — usa azul marinho como base */
[data-bs-theme="dark"] {
    background-color: var(--rm-navy) !important;
    color: #ffffff !important;
}
[data-bs-theme="dark"] .bg-light {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

/* Login page */
.login-bg {
    background: linear-gradient(135deg, var(--rm-navy) 0%, #253d52 100%);
    min-height: 100vh;
}

.login-card {
    border: none;
    border-top: 4px solid var(--rm-orange);
    border-radius: 0.5rem;
}

.login-card .form-control:focus {
    border-color: var(--rm-orange);
    box-shadow: 0 0 0 0.2rem rgba(235, 148, 0, 0.25);
}

/* Navbar brand logo */
.navbar-brand img {
    height: 32px;
    margin-right: 0.5rem;
}

/* ========================================
   Atalho — Novo Servico (Dashboard)
   ======================================== */
.shortcut-section {
    margin-bottom: 1.5rem;
}

.shortcut-card {
    display: block;
    text-decoration: none !important;
}

.shortcut-card .card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-left: 3px solid transparent;
    overflow: hidden;
}

.shortcut-card:hover .card,
.shortcut-card:focus .card {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-left-color: var(--rm-orange);
}

.shortcut-card:active .card {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shortcut-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rm-orange) 0%, var(--rm-orange-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.4rem;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.shortcut-card:hover .shortcut-icon {
    transform: scale(1.1) rotate(-5deg);
}

.shortcut-label {
    color: var(--rm-navy);
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.3;
}

.shortcut-sublabel {
    color: #6c757d;
    font-size: 0.75rem;
    margin: 0;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .shortcut-card .card {
    border-color: rgba(255, 255, 255, 0.08);
}
[data-bs-theme="dark"] .shortcut-card:hover .card {
    border-left-color: var(--rm-orange);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
[data-bs-theme="dark"] .shortcut-label {
    color: #ffffff;
}

/* ========================================
   Dashboard — Cards Clicáveis
   ======================================== */
.dashboard-card-link {
    display: block;
    text-decoration: none !important;
    color: inherit !important;
}
.dashboard-card-link .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-left: 3px solid transparent;
}
.dashboard-card-link:hover .card,
.dashboard-card-link:focus .card {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    border-left-color: var(--rm-orange);
}
.dashboard-card-link:active .card {
    transform: translateY(-1px);
}
[data-bs-theme="dark"] .dashboard-card-link .card {
    border-color: rgba(255, 255, 255, 0.08);
}
[data-bs-theme="dark"] .dashboard-card-link:hover .card {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* ========================================
   Botao Detalhes — Listagens
   ======================================== */
.table-responsive table {
    width: 100% !important;
}

.btn-detalhes {
    white-space: nowrap;
    --bs-btn-color: var(--rm-orange);
    --bs-btn-border-color: var(--rm-orange);
    --bs-btn-hover-bg: var(--rm-orange);
    --bs-btn-hover-border-color: var(--rm-orange);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--rm-orange-hover);
    --bs-btn-active-border-color: var(--rm-orange-hover);
    --bs-btn-active-color: #fff;
}

@media (max-width: 767.98px) {
    .btn-detalhes {
        width: 32px;
        height: 32px;
        padding: 0;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 50% !important;
    }
}

/* ========================================
   Foto Upload — Meus Dados
   ======================================== */
.foto-upload-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.foto-upload-wrapper img {
    width: 150px;
    height: 150px;
    object-fit: cover;
}

.foto-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #fff;
    font-size: 2rem;
}

.foto-upload-wrapper:hover .foto-upload-overlay {
    opacity: 1;
}

.foto-upload-drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    font-size: 1.5rem;
    pointer-events: none;
    z-index: 2;
}
.foto-upload-drag-overlay small {
    font-size: 0.7rem;
    margin-top: 2px;
}
.foto-upload-drag-overlay.active {
    display: flex;
}

.foto-upload-hint {
    font-size: 0.8rem;
    color: #6c757d;
}

@media (max-width: 767.98px) {
    .foto-upload-overlay {
        opacity: 0.6;
    }
}

/* Dark mode */
[data-bs-theme="dark"] .foto-upload-overlay {
    background: rgba(0, 0, 0, 0.6);
}

[data-bs-theme="dark"] .foto-upload-hint {
    color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   Alterar Senha — Meus Dados
   ======================================== */
.senha-collapse-toggle {
    padding: 0.25rem 0;
}

.senha-collapse-icon {
    transition: transform 0.3s ease;
    font-size: 0.85rem;
    color: #6c757d;
}

.senha-strength {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.senha-strength-bar {
    height: 100%;
    border-radius: 2px;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.btn-toggle-senha {
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .senha-strength {
    background: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .senha-collapse-icon {
    color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   Supervisor — Seletor de Universo (Breadcrumb)
   ======================================== */
.universo-selector {
    color: var(--rm-orange);
    font-weight: 500;
}
.universo-selector:hover,
.universo-selector:focus {
    color: var(--rm-orange-hover);
}
.universo-dropdown {
    max-height: 300px;
    overflow-y: auto;
}
.universo-dropdown .dropdown-item.active {
    background-color: var(--rm-orange);
    border-color: var(--rm-orange);
}

/* ========================================
   Ad Slots (Sidebars Desktop + Banner Mobile)
   ======================================== */
.ad-sidebar {
    position: fixed;
    top: 120px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.ad-slot {
    min-height: 250px;
    border-radius: 0.375rem;
    background: rgba(0, 0, 0, 0.02);
}

.ad-slot:empty,
.ad-slot:has(> :empty:only-child) {
    display: none;
}

/* Modo two_sides: sidebars 180px de cada lado, conteúdo centralizado */
@media (min-width: 1720px) {
    body.ad-layout-two-sides .ad-sidebar-esq,
    body.ad-layout-two-sides .ad-sidebar-dir {
        display: block;
        width: 180px;
    }
    body.ad-layout-two-sides .ad-sidebar-esq {
        left: calc((100vw - 1320px) / 2 - 200px);
    }
    body.ad-layout-two-sides .ad-sidebar-dir {
        right: calc((100vw - 1320px) / 2 - 200px);
    }
}

/* Modo right_only: sidebar única 260px à direita, conteúdo empurrado à esquerda */
@media (min-width: 1600px) {
    body.ad-layout-right-only main.container,
    body.ad-layout-right-only > .container,
    body.ad-layout-right-only footer .container {
        margin-left: 1.5rem;
        margin-right: auto;
    }
    body.ad-layout-right-only .ad-sidebar-dir {
        display: block;
        width: 260px;
        right: 1.5rem;
    }
}

/* Banner mobile (ambos os modos, abaixo de md) */
.ad-banner-mobile {
    padding: 0.5rem 0;
    background: rgba(0, 0, 0, 0.02);
}

.ad-banner-mobile .ad-slot {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark mode */
[data-bs-theme="dark"] .ad-slot,
[data-bs-theme="dark"] .ad-banner-mobile {
    background: rgba(255, 255, 255, 0.04);
}
