/* ============================================
   CetNet - Portal do Colaborador CETURB
   Design System & Global Styles
   ============================================ */

:root {
    --brand-pink: #ED1556;
    --brand-blue: #00AEEF;
    --brand-gray: #58595B;
    --brand-dark-gray: #3a3b3c;
    --brand-white: #ffffff;
    --brand-bg-light: #f4f7f9;
    --brand-pink-light: rgba(237, 21, 86, 0.08);
    --brand-blue-light: rgba(0, 174, 239, 0.08);
    --brand-pink-glow: rgba(237, 21, 86, 0.25);
    --brand-blue-glow: rgba(0, 174, 239, 0.25);
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --header-height: 68px;
    --card-radius: 20px;
    --card-shadow: 0 2px 16px rgba(0,0,0,0.06);
    --card-shadow-hover: 0 8px 32px rgba(0,0,0,0.12);
    --transition-default: all 0.3s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Poppins', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    color: var(--brand-dark-gray);
    background: var(--brand-bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, .h1 {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
}

h2, .h2 {
    font-size: 26px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

h3, .h3 {
    font-size: 20px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

small, .small {
    font-size: 13px;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: rgba(0,0,0,0.25);
    }

#blazor-error-ui {
    background: var(--brand-pink);
    color: white;
    padding: 0.8rem 1.5rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 9999;
    text-align: center;
    display: none;
}

    #blazor-error-ui .reload {
        color: white;
        text-decoration: underline;
    }

    #blazor-error-ui .dismiss {
        cursor: pointer;
        margin-left: 1rem;
    }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Ocorreu um erro.";
    }

/* SHARED: Card Header (usado por multiplos componentes) */
.card-header-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

    .card-header-custom h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: var(--brand-dark-gray);
    }

    .card-header-custom .card-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
    }

.card-icon.pink {
    background: var(--brand-pink-light);
    color: var(--brand-pink);
}

.card-icon.blue {
    background: var(--brand-blue-light);
    color: var(--brand-blue);
}

/* BUTTONS */
.btn-brand-pink {
    background: var(--brand-pink);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-default);
}

    .btn-brand-pink:hover {
        background: #d4124e;
        transform: scale(1.02);
        box-shadow: 0 4px 16px var(--brand-pink-glow);
        color: white;
    }

.btn-brand-blue {
    background: var(--brand-blue);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-default);
}

    .btn-brand-blue:hover {
        background: #009ad6;
        transform: scale(1.02);
        box-shadow: 0 4px 16px var(--brand-blue-glow);
        color: white;
    }

.btn-outline-brand {
    background: transparent;
    color: var(--brand-blue);
    border: 2px solid var(--brand-blue);
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-default);
}

    .btn-outline-brand:hover {
        background: var(--brand-blue);
        color: white;
    }

/* PAGE HEADER */
.page-header {
    margin-bottom: 24px;
}

    .page-header h1 {
        font-size: 28px;
        font-weight: 700;
        color: var(--brand-dark-gray);
        margin: 0 0 4px;
    }

    .page-header p {
        color: var(--brand-gray);
        font-size: 14px;
        margin: 0;
    }

/* INFO CARD */
.info-card {
    background: var(--brand-white);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 28px;
    transition: var(--transition-default);
    margin-bottom: 20px;
}

    .info-card:hover {
        box-shadow: var(--card-shadow-hover);
    }

/* SYSTEM CARDS */
.system-card {
    background: var(--brand-white);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
    text-align: center;
    transition: var(--transition-default);
}

    .system-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--card-shadow-hover);
    }

    .system-card .system-icon {
        width: 64px;
        height: 64px;
        border-radius: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        margin: 0 auto 16px;
    }

    .system-card h4 {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 8px;
    }

    .system-card p {
        font-size: 13px;
        color: var(--brand-gray);
        margin-bottom: 16px;
    }

/* RAMAL CARDS */
/*.ramal-card {
    background: var(--brand-white);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 20px;
    transition: var(--transition-default);
}

    .ramal-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--card-shadow-hover);
    }

    .ramal-card h4 {
        font-size: 15px;
        font-weight: 600;
        margin-bottom: 12px;
        color: var(--brand-dark-gray);
    }

.ramal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 13px;
}

    .ramal-item:last-child {
        border-bottom: none;
    }*/

/* CHAT */
.chat-container {
    display: flex;
    height: calc(100vh - var(--header-height) - 120px);
    background: var(--brand-white);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.chat-sidebar {
    width: 280px;
    border-right: 1px solid rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
}

.chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-weight: 600;
    font-size: 16px;
}

.chat-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition-default);
}

    .chat-contact:hover, .chat-contact.active {
        background: var(--brand-bg-light);
    }

    .chat-contact .contact-avatar {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        background: var(--brand-blue-light);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        color: var(--brand-blue);
        flex-shrink: 0;
    }

    .chat-contact .contact-info h4 {
        font-size: 14px;
        font-weight: 600;
        margin: 0;
    }

    .chat-contact .contact-info p {
        font-size: 12px;
        color: var(--brand-gray);
        margin: 0;
    }

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

    .chat-message.sent {
        align-self: flex-end;
        background: var(--brand-blue);
        color: white;
        border-bottom-right-radius: 4px;
    }

    .chat-message.received {
        align-self: flex-start;
        background: var(--brand-bg-light);
        color: var(--brand-dark-gray);
        border-bottom-left-radius: 4px;
    }

.chat-input-area {
    padding: 16px;
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    gap: 12px;
}

    .chat-input-area input {
        flex: 1;
        padding: 10px 16px;
        border: 2px solid rgba(0,0,0,0.06);
        border-radius: 12px;
        font-size: 14px;
        outline: none;
        transition: var(--transition-default);
    }

        .chat-input-area input:focus {
            border-color: var(--brand-blue);
        }

    .chat-input-area button {
        padding: 10px 20px;
        border-radius: 12px;
        border: none;
        background: var(--brand-blue);
        color: white;
        font-weight: 600;
        cursor: pointer;
        transition: var(--transition-default);
    }

        .chat-input-area button:hover {
            background: #009ad6;
        }

/* INFOMAP */
.infomap-step {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 16px;
    transition: var(--transition-default);
    position: relative;
}

    .infomap-step:hover {
        border-color: var(--brand-blue);
        box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    }

    .infomap-step::after {
        content: '';
        position: absolute;
        bottom: -16px;
        left: 50%;
        transform: translateX(-50%);
        width: 2px;
        height: 16px;
        background: var(--brand-blue);
    }

    .infomap-step:last-child::after {
        display: none;
    }

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
}

.step-content p {
    font-size: 13px;
    color: var(--brand-gray);
    margin: 0;
}

/* SETOR CARDS */
.setor-card {
    background: var(--brand-white);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
    transition: var(--transition-default);
    text-align: center;
}

    .setor-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--card-shadow-hover);
    }

.setor-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 12px;
}

/* CONFETTI (injetado via JS no DOM global) */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 9999;
    animation: confetti-fall 3s ease-in-out forwards;
}

/* UTILITIES */
.text-pink {
    color: var(--brand-pink) !important;
}

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

.text-gray {
    color: var(--brand-gray) !important;
}

.text-dark-gray {
    color: var(--brand-dark-gray) !important;
}

.bg-pink-light {
    background: var(--brand-pink-light) !important;
}

.bg-blue-light {
    background: var(--brand-blue-light) !important;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--brand-gray);
    margin: 8px 16px 4px;
}

.glass-card {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
}

/* ANIMATIONS */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.4s ease forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

/* RESPONSIVE GLOBAL */
@media (max-width: 992px) {
    .chat-sidebar {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
        height: auto;
    }

    .chat-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.06);
        max-height: 200px;
        overflow-y: auto;
    }

    .chat-messages {
        min-height: 300px;
    }
}
