/**
 * ============================================================================
 * COMPONENTES VISUAIS REUTILIZÁVEIS - SISTEMA TMS
 * ============================================================================
 * Biblioteca de componentes modernos para uso em todo o sistema
 * Versão: 1.0
 * Data: 2026-02-07
 * ============================================================================
 */

/* ============================================================================
   1. CARDS ESPECIALIZADOS
   ============================================================================ */

/* Card de Ação Rápida */
.quick-action-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.quick-action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease-out;
}

.quick-action-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.quick-action-card:hover::before {
    transform: scaleX(1);
}

.quick-action-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    color: var(--primary-color);
}

.quick-action-card:hover .quick-action-icon {
    transform: scale(1.15) rotate(-5deg);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.quick-action-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.quick-action-description {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* Card de Status com Timeline */
.status-timeline-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 40px;
    width: 2px;
    height: calc(100% - 20px);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--gray-300) 100%);
}

.timeline-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.5);
    }
}

.timeline-dot.completed {
    background: linear-gradient(135deg, var(--success-color), var(--success-light));
    animation: none;
}

.timeline-dot.pending {
    background: linear-gradient(135deg, var(--gray-400), var(--gray-300));
    animation: none;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.timeline-time {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* Card Informativo com Ícone Grande */
.info-card-large {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(249, 250, 251, 0.95));
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.info-card-large::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
    animation: rotateGlow 10s linear infinite;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.info-card-large:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.info-card-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
    position: relative;
    z-index: 1;
}

/* ============================================================================
   2. BOTÕES ESPECIALIZADOS
   ============================================================================ */

/* Botão Flutuante de Ação (FAB) */
.fab-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.fab-button:hover {
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.5);
}

.fab-button:active {
    transform: scale(1.05) rotate(90deg);
}

/* Botão com Ícone e Label */
.btn-icon-label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease-out;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-icon-label .icon {
    font-size: 1.25rem;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.btn-icon-label:hover .icon {
    transform: scale(1.2) rotate(5deg);
}

.btn-icon-label.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-icon-label.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

/* Botão de Grupo com Separadores */
.btn-group-separated .btn {
    position: relative;
    margin-right: 1rem;
}

.btn-group-separated .btn:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -0.5rem;
    top: 25%;
    height: 50%;
    width: 1px;
    background: var(--gray-300);
}

/* ============================================================================
   3. BADGES AVANÇADOS
   ============================================================================ */

/* Badge com Ícone */
.badge-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease-out;
}

.badge-with-icon i {
    font-size: 1rem;
}

.badge-with-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Badge com Contador */
.badge-counter {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.badge-counter .count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, var(--error-color), #f87171);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: popIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Badge de Status com Dot */
.badge-status-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.8125rem;
}

.badge-status-dot::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulseDot 2s ease-in-out infinite;
}

.badge-status-dot.status-active::before {
    background: var(--success-color);
}

.badge-status-dot.status-pending::before {
    background: var(--warning-color);
}

.badge-status-dot.status-inactive::before {
    background: var(--gray-400);
}

@keyframes pulseDot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* ============================================================================
   4. INPUTS ESPECIALIZADOS
   ============================================================================ */

/* Input com Ícone Flutuante */
.input-floating-icon {
    position: relative;
}

.input-floating-icon input {
    padding-left: 3rem;
}

.input-floating-icon .icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    transition: all 0.3s ease-out;
    font-size: 1.25rem;
}

.input-floating-icon input:focus ~ .icon {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

/* Input com Validação Visual Inline */
.input-validation {
    position: relative;
}

.input-validation .validation-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    opacity: 0;
    transition: all 0.3s ease-out;
}

.input-validation.is-valid .validation-icon.success {
    opacity: 1;
    color: var(--success-color);
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.input-validation.is-invalid .validation-icon.error {
    opacity: 1;
    color: var(--error-color);
    animation: shake 0.5s;
}

@keyframes bounceIn {
    0% {
        transform: translateY(-50%) scale(0);
    }
    50% {
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    25% { transform: translateY(-50%) translateX(-5px); }
    75% { transform: translateY(-50%) translateX(5px); }
}

/* Search Bar Moderna */
.search-bar-modern {
    position: relative;
    max-width: 500px;
}

.search-bar-modern input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 3.5rem;
    border: 2px solid var(--gray-200);
    border-radius: 50px;
    font-size: 0.9375rem;
    transition: all 0.3s ease-out;
    background: white;
}

.search-bar-modern input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1),
                0 8px 24px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.search-bar-modern .search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.25rem;
    transition: color 0.3s;
}

.search-bar-modern input:focus ~ .search-icon {
    color: var(--primary-color);
}

.search-bar-modern .clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s;
}

.search-bar-modern .clear-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* ============================================================================
   5. PROGRESS E LOADING
   ============================================================================ */

/* Progress Bar Circular */
.circular-progress {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(
        var(--primary-color) 0deg,
        var(--primary-light) var(--progress-angle, 0deg),
        var(--gray-200) var(--progress-angle, 0deg)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: rotateProgress 2s ease-in-out infinite;
}

.circular-progress::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: white;
}

.circular-progress .percentage {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Skeleton Loader Avançado */
.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.skeleton-line.title {
    height: 20px;
    width: 60%;
}

.skeleton-line.short {
    width: 40%;
}

.skeleton-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

/* Loading Spinner Moderno */
.spinner-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.spinner-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: bounceDot 1.4s ease-in-out infinite;
}

.spinner-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.spinner-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounceDot {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================================================
   6. TOOLTIPS CUSTOMIZADOS
   ============================================================================ */

.tooltip-custom {
    position: relative;
    display: inline-block;
}

.tooltip-custom .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--gray-900);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    white-space: nowrap;
    z-index: 1000;
    transition: all 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tooltip-custom .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--gray-900);
}

.tooltip-custom:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================================
   7. CHIPS E TAGS
   ============================================================================ */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease-out;
}

.chip:hover {
    background: var(--gray-200);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chip .chip-close {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.75rem;
}

.chip .chip-close:hover {
    background: var(--error-color);
    color: white;
    transform: rotate(90deg);
}

/* ============================================================================
   8. ACCORDIONS MODERNOS
   ============================================================================ */

.accordion-modern .accordion-item {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease-out;
}

.accordion-modern .accordion-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.accordion-modern .accordion-header {
    background: white;
}

.accordion-modern .accordion-button {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    background: white;
    border: none;
    transition: all 0.3s;
}

.accordion-modern .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(59, 130, 246, 0.02));
    color: var(--primary-color);
}

.accordion-modern .accordion-body {
    padding: 1.5rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   9. TABS MODERNOS
   ============================================================================ */

.tabs-modern {
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    gap: 0.5rem;
}

.tabs-modern .tab {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.tabs-modern .tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease-out;
}

.tabs-modern .tab:hover {
    color: var(--primary-color);
}

.tabs-modern .tab.active {
    color: var(--primary-color);
}

.tabs-modern .tab.active::after {
    transform: scaleX(1);
}

/* ============================================================================
   10. EMPTY STATES
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary-color);
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================================
   RESPONSIVIDADE
   ============================================================================ */

@media (max-width: 768px) {
    .quick-action-card {
        padding: 1rem;
    }
    
    .quick-action-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .fab-button {
        width: 50px;
        height: 50px;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.25rem;
    }
    
    .info-card-icon-large {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .search-bar-modern {
        max-width: 100%;
    }
}
