﻿/* ========================================================================================
   USER AREA - DESIGN MODERNO E FUTURÍSTICO
   Sistema Quadro Horário
   ======================================================================================== */
/* Centraliza o container .main na tela */
.main {
    display: flex;
    justify-content: center;
    align-content: center;
    align-items: center;
    margin: 5px auto;
    max-width: 1920px;
    padding: 0;
}
/* ------------------------
   VARIÁVEIS
   ------------------------ */
:root {
    --user-primary: #004A8D;
    --user-primary-dark: #003A6D;
    --user-accent: #F7941D;
    --user-accent-light: #FDC180;
    --user-bg: rgba(255, 255, 255, 0.95);
    --user-border: rgba(0, 74, 141, 0.2);
    --user-shadow: rgba(0, 74, 141, 0.15);
    --user-hover: rgba(247, 148, 29, 0.1);
}

/* ------------------------
   CONTAINER PRINCIPAL
   ------------------------ */
.user-area {
    display: flex;
    align-items: stretch; /* Faz os itens ocuparem toda a altura */
    justify-content: space-between; /* Distribui o espaço uniformemente */
    gap: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--user-bg), rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(10px);
    border-radius: 50px;
    box-shadow: 0 4px 16px var(--user-shadow);
    border: 2px solid var(--user-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto; /* Empurra para a direita */
    margin-top: 5px;
    margin-right: 20px;
    margin-bottom: 5px;
    width: auto;
    min-width: fit-content;
}

    .user-area:hover {
        box-shadow: 0 6px 24px rgba(0, 74, 141, 0.2);
        border-color: var(--user-primary);
        transform: translateY(-1px);
    }

/* ------------------------
   BADGE DO USUÁRIO
   ------------------------ */
.user-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--user-primary-dark), var(--user-primary));
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 74, 141, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex: 1 1 auto; /* Permite crescimento proporcional */
    min-width: 100px;
}

    /* Efeito de brilho no badge */
    .user-badge::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient( 45deg, transparent, rgba(255, 255, 255, 0.3), transparent );
        transform: rotate(45deg) translateX(-100%);
        transition: transform 0.6s ease;
    }

    .user-badge:hover::before {
        transform: rotate(45deg) translateX(100%);
    }

    .user-badge:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(0, 74, 141, 0.4);
    }

/* ------------------------
   BOTÃO ALTERAR SENHA
   ------------------------ */
.user-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(247, 148, 29, 0.1), rgba(247, 148, 29, 0.05));
    color: var(--user-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 50px;
    border: 2px solid rgba(247, 148, 29, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex: 1 1 auto; /* Permite crescimento proporcional */
    min-width: 120px;
}

    /* Barra animada no topo */
    .user-action::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background: linear-gradient(90deg, var(--user-accent), var(--user-accent-light));
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.3s ease;
    }

    .user-action:hover::before {
        transform: scaleX(1);
    }

    .user-action:hover {
        background: linear-gradient(135deg, rgba(247, 148, 29, 0.2), rgba(247, 148, 29, 0.1));
        border-color: var(--user-accent);
        color: var(--user-primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(247, 148, 29, 0.3);
    }

    .user-action:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(247, 148, 29, 0.2);
    }

/* ------------------------
   BOTÃO REDIRECT (HOME) - VERSÃO COM TEXTO
   ------------------------ */
.user-redirect-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(0, 102, 179, 0.1), rgba(0, 74, 141, 0.05));
    color: var(--user-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 50px;
    border: 2px solid rgba(0, 102, 179, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex: 1 1 auto; /* Permite crescimento proporcional */
    min-width: 180px;
}

/* Ícone à direita */
.user-redirect-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: auto; /* Empurra o ícone para a direita */
}

/* Efeito de onda no clique */
.user-redirect-text::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50px;
    background: rgba(0, 102, 179, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.user-redirect-text:active::after {
    width: 100%;
    height: 100%;
}

.user-redirect-text:hover {
    background: linear-gradient(135deg, rgba(0, 102, 179, 0.2), rgba(0, 74, 141, 0.1));
    border-color: var(--user-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 179, 0.3);
}

    .user-redirect-text:hover .user-redirect-icon {
        transform: scale(1.2);
    }

/* Botão redirect original (circular) - mantido para compatibilidade */
.user-redirect:not(.user-redirect-text) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    background: linear-gradient(135deg, rgba(0, 102, 179, 0.1), rgba(0, 74, 141, 0.05));
    color: var(--user-primary);
    font-size: 1.3rem;
    text-decoration: none;
    border-radius: 50%;
    border: 2px solid rgba(0, 102, 179, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

    .user-redirect:not(.user-redirect-text)::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(0, 102, 179, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.4s ease, height 0.4s ease;
    }

    .user-redirect:not(.user-redirect-text):active::after {
        width: 100%;
        height: 100%;
    }

    .user-redirect:not(.user-redirect-text):hover {
        background: linear-gradient(135deg, rgba(0, 102, 179, 0.2), rgba(0, 74, 141, 0.1));
        border-color: var(--user-primary);
        transform: rotate(360deg) scale(1.1);
        box-shadow: 0 4px 12px rgba(0, 102, 179, 0.3);
    }

/* ------------------------
   BOTÃO LOGOUT
   ------------------------ */
.user-logout,
.user-logout a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    color: #dc3545;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 50px;
    border: 2px solid rgba(220, 53, 69, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex: 1 1 auto; /* Permite crescimento proporcional */
    min-width: 80px;
}

    /* Efeito de preenchimento ao hover */
    .user-logout::before,
    .user-logout a::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50px;
        background: rgba(220, 53, 69, 0.1);
        transform: translate(-50%, -50%);
        transition: width 0.4s ease, height 0.4s ease;
        z-index: -1;
    }

    .user-logout:hover::before,
    .user-logout a:hover::before {
        width: 200%;
        height: 200%;
    }

    .user-logout:hover,
    .user-logout a:hover {
        background: linear-gradient(135deg, rgba(220, 53, 69, 0.2), rgba(220, 53, 69, 0.1));
        border-color: #dc3545;
        color: #c82333;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    }

    .user-logout:active,
    .user-logout a:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
    }

/* ------------------------
   SEPARADOR
   ------------------------ */
.user-sep {
    display: inline-block;
    width: 1px;
    height: 24px;
    background: linear-gradient(180deg, transparent, rgba(0, 74, 141, 0.3), transparent);
    margin: 0 4px;
    flex-shrink: 0;
    align-self: center;
}

/* ------------------------
   RESPONSIVIDADE
   ------------------------ */

/* Desktop grande (acima de 1200px) - Comportamento padrão com flex */
@media (min-width: 1200px) {
    .user-area {
        gap: 14px;
        padding: 10px 20px;
    }

    .user-badge {
        flex: 1 1 15%; /* 15% do espaço disponível */
        max-width: 200px;
    }

    .user-action {
        flex: 1 1 20%; /* 20% do espaço disponível */
        max-width: 180px;
    }

    .user-redirect-text {
        flex: 1 1 25%; /* 25% do espaço disponível */
        max-width: 250px;
    }

    .user-logout,
    .user-logout a {
        flex: 1 1 15%; /* 15% do espaço disponível */
        max-width: 120px;
    }
}

/* Tablets e laptops (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .user-area {
        gap: 10px;
        padding: 8px 16px;
    }

    .user-badge,
    .user-action,
    .user-redirect-text,
    .user-logout,
    .user-logout a {
        flex: 1 1 auto;
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .user-redirect:not(.user-redirect-text) {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }
}

/* Tablets pequenos (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .user-area {
        gap: 8px;
        padding: 6px 12px;
    }

    .user-badge,
    .user-action,
    .user-redirect-text,
    .user-logout,
    .user-logout a {
        flex: 1 1 auto;
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .user-redirect:not(.user-redirect-text) {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .user-redirect-icon {
        font-size: 1.1rem;
    }
}

/* Smartphones (abaixo de 768px) */
@media (max-width: 767px) {
    .user-area {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px;
        border-radius: 20px;
        justify-content: center;
        margin-left: 5px;
        margin-right: 5px;
    }

    .user-badge {
        flex: 1 1 100%;
        text-align: center;
        max-width: 100%;
    }

    .user-action,
    .user-redirect-text,
    .user-logout {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
    }

    .user-redirect:not(.user-redirect-text) {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .user-sep {
        display: none;
    }
}

/* Smartphones pequenos (abaixo de 480px) */
@media (max-width: 479px) {
    .user-area {
        flex-direction: column;
        gap: 6px;
        padding: 6px;
        border-radius: 12px;
        width: calc(100% - 10px);
    }

    .user-badge,
    .user-action,
    .user-redirect-text,
    .user-logout,
    .user-logout a {
        flex: 1 1 100%;
        width: 100%;
        padding: 8px 12px;
        font-size: 0.75rem;
        max-width: 100%;
    }

    .user-badge {
        font-size: 0.8rem;
    }

    .user-action {
        font-size: 0.7rem;
    }

    .user-redirect:not(.user-redirect-text) {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .user-redirect-text {
        font-size: 0.7rem;
    }

    .user-redirect-icon {
        font-size: 1rem;
    }

    .user-sep {
        display: none;
    }
}

/* ------------------------
   ACESSIBILIDADE
   ------------------------ */

/* Foco visível */
.user-action:focus-visible,
.user-redirect:focus-visible,
.user-redirect-text:focus-visible,
.user-logout:focus-visible,
.user-logout a:focus-visible {
    outline: 3px solid var(--user-accent);
    outline-offset: 3px;
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .user-area {
        border-width: 3px;
    }

    .user-badge,
    .user-action,
    .user-redirect,
    .user-redirect-text,
    .user-logout,
    .user-logout a {
        border-width: 3px;
    }
}

/* Redução de movimento */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
