/* Estilos personalizados para o EvolutionAPI */
:root {
    --primary: #6c5ce7;
    --primary-dark: #5649c0;
    --secondary: #a29bfe;
    --success: #00b894;
    --info: #0984e3;
    --warning: #fdcb6e;
    --danger: #ff7675;
    --light: #f8f9fa;
    --dark: #2d3436;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --border-radius: 0.5rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Layout */
html, body {
    height: 100%;
    font-family: var(--font-sans);
    color: var(--gray-800);
    background-color: #f5f7fb;
    line-height: 1.5;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: 250px;
    background: linear-gradient(180deg, #6c5ce7 0%, #5649c0 100%);
    color: white;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.5rem 1.5rem 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: white !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand i {
    font-size: 1.75rem;
}

.sidebar-menu {
    flex: 1;
    padding: 1rem 0.5rem;
    overflow-y: auto;
}

.sidebar-menu-section {
    margin: 1.5rem 0;
}

.sidebar-menu-section:first-child {
    margin-top: 0;
}

.sidebar-menu-title {
    padding: 0.5rem 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    margin: 0.25rem 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1.1em;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.sidebar .nav-link.text-danger:hover {
    background: rgba(255, 118, 117, 0.15);
    color: #ff7675 !important;
}

/* Conteúdo Principal */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f7fb;
    transition: margin 0.3s ease;
}

.content {
    flex: 1;
    padding: 2rem;
}

/* Top Bar */
.top-bar {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: white;
    overflow: hidden;
}

.card.border-0 {
    box-shadow: var(--shadow-sm);
}

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

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

.card-header {
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header.bg-white {
    background-color: white !important;
}

/* Gradient Cards */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success) 0%, #00a884 100%) !important;
}

.bg-gradient-info {
    background: linear-gradient(135deg, var(--info) 0%, #0a7bc4 100%) !important;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #f9c74f 100%) !important;
}

/* Stats Cards */
.icon-shape {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-shrink: 0;
}

.icon-shape i {
    font-size: 1.25rem;
}

.bg-white-10 {
    background-color: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(8px);
}

/* Badges */
.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
}

.badge.bg-opacity-10 {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: inherit;
}

/* Dot Indicator */
.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

/* Auth Container */
.auth-container {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* List Group */
.list-group-item {
    border: none;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.2s ease;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: var(--gray-50);
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 1rem;
    text-transform: uppercase;
    flex-shrink: 0;
    position: relative;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-online::after,
.avatar-offline::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.avatar-online::after {
    background-color: var(--success);
}

.avatar-offline::after {
    background-color: var(--secondary);
}

/* Activity Item */
.activity-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

.activity-item:last-child {
    margin-bottom: 0;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: -1.5rem;
    width: 2px;
    background-color: var(--gray-200);
}

.activity-item:last-child::before {
    display: none;
}

.activity-indicator {
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid #fff;
    z-index: 1;
}

.activity-indicator.primary {
    background-color: var(--primary);
}

.activity-indicator.success {
    background-color: var(--success);
}

.activity-indicator.warning {
    background-color: var(--warning);
}

.activity-indicator.danger {
    background-color: var(--danger);
}

.activity-indicator.info {
    background-color: var(--info);
}

/* Activity Content */
.activity-content {
    position: relative;
    padding: 0.75rem 1rem;
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Flex Utilities */
.flex-shrink-0 {
    flex-shrink: 0;
}

.flex-grow-1 {
    flex-grow: 1;
}

/* Text Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover Effects */
.hover-shadow {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hover-shadow:hover {
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid var(--gray-300) !important;
        box-shadow: none !important;
    }
}

/* Progress */
.progress {
    height: 6px;
    border-radius: 3px;
    background-color: var(--gray-200);
    overflow: visible;
}

.progress-bar {
    border-radius: 3px;
    position: relative;
    overflow: visible;
}

.progress.rounded-pill {
    border-radius: 100px;
}

.progress.rounded-pill .progress-bar {
    border-radius: 100px;
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1.25rem;
}

/* Buttons */
.btn {
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--border-radius);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
}

.btn i {
    font-size: 1.1em;
    line-height: 1;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.rounded-pill {
    border-radius: 50rem !important;
}

/* Text Colors */
.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Spacing Utilities */
.g-4 {
    gap: 1.5rem !important;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .top-bar .btn-sidebar-toggle {
        display: block;
    }
}

/* Dark mode desativado */

/* Botões */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn i {
    font-size: 1.1em;
}

.btn-primary {
    background-color: #6c5ce7;
    border-color: #6c5ce7;
}

.btn-primary:hover {
    background-color: #5649c0;
    border-color: #5649c0;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: #6c5ce7;
    border-color: #6c5ce7;
}

.btn-outline-primary:hover {
    background-color: #6c5ce7;
    border-color: #6c5ce7;
}

/* Formulários */
.form-control {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: #a29bfe;
    box-shadow: 0 0 0 0.2rem rgba(108, 92, 231, 0.15);
}

/* Tabelas */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
}

/* Responsividade */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content {
        padding: 1rem;
    }
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Layout para autenticação */
.auth-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

.auth-layout .navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
}

.auth-container-wrapper {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 80px);
}

.auth-banner {
    flex: 1;
    background: linear-gradient(135deg, #6c5ce7 0%, #5649c0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../img/banner-login.png') center/cover no-repeat;
    opacity: 0.15;
    z-index: 1;
}

.auth-banner-content {
    position: relative;
    z-index: 2;
    max-width: 500px;
    color: white;
    text-align: center;
}

.auth-banner h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.auth-banner p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.auth-form-container {
    width: 100%;
    max-width: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background-color: #ffffff;
    position: relative;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Responsividade */
@media (max-width: 991.98px) {
    .auth-container-wrapper {
        flex-direction: column;
    }
    
    .auth-banner {
        padding: 4rem 2rem;
        min-height: 300px;
    }
    
    .auth-banner h1 {
        font-size: 2rem;
    }
    
    .auth-form-container {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }
}

/* Melhorias no formulário */
.auth-container .card {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    overflow: hidden;
}

.auth-container .card-body {
    padding: 2rem;
}

.auth-container .form-control {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.auth-container .form-control:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 0.15rem rgba(108, 92, 231, 0.15);
}

.auth-container .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.auth-container .btn-primary {
    background: linear-gradient(135deg, #6c5ce7 0%, #5649c0 100%);
    border: none;
}

.auth-container .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

/* Layout de Autenticação */
.auth-container-wrapper {
    display: flex;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

/* Banner Lateral */
.auth-banner {
    flex: 1;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.9) 0%, rgba(86, 73, 192, 0.9) 100%), 
                url('../../assets/img/banner-login.png') center/cover no-repeat;
    color: white;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 100vh;
}

.auth-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.auth-banner-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    padding: 2rem;
}

.auth-banner h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.auth-banner p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Container do Formulário */
.auth-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
    height: 100vh;
    box-sizing: border-box;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-in-out;
    padding: 1.5rem 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-container .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin: 0;
}

.auth-container .card-body {
    padding: 2rem;
}

.auth-container h2 {
    color: #2d3436;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-container .text-muted {
    color: #6c757d !important;
    margin-bottom: 2rem;
    display: block;
}

/* Melhorias nos inputs */
.auth-container .form-control {
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    height: calc(1.5em + 1.25rem + 2px);
}

.auth-container .form-control:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 0.2rem rgba(108, 92, 231, 0.25);
}

.auth-container .input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-right: none;
    color: #6c5ce7;
    padding: 0 1rem;
}

.auth-container .input-group .form-control {
    border-left: none;
    padding-left: 0;
}

/* Botão de alternar senha */
.toggle-password {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
    background-color: #f8f9fa !important;
    color: #6c757d !important;
}

.toggle-password:hover {
    background-color: #e9ecef !important;
}

/* Botão de submit */
.btn-primary {
    background: linear-gradient(135deg, #6c5ce7 0%, #5649c0 100%);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 8px;
}

/* Responsividade */
@media (max-width: 991.98px) {
    .auth-container-wrapper {
        flex-direction: column;
        max-height: none;
        height: auto;
        min-height: 100vh;
    }
    
    .auth-banner {
        padding: 3rem 1.5rem;
        height: auto;
        min-height: 30vh;
    }
    
    .auth-banner-content {
        padding: 1rem !important;
    }
    
    .auth-banner h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem !important;
    }
    
    .auth-banner p {
        font-size: 1rem;
        margin-bottom: 1.5rem !important;
    }
    
    .auth-form-container {
        padding: 1.5rem 1rem;
        height: auto;
        min-height: 70vh;
    }
    
    .auth-container {
        padding: 0.5rem 0 !important;
    }
    
    .auth-container .card-body {
        padding: 1.5rem !important;
    }
}

/* Telas muito pequenas */
@media (max-width: 575.98px) {
    .auth-banner {
        padding: 2rem 1rem !important;
        min-height: 35vh !important;
    }
    
    .auth-banner h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .auth-banner p {
        font-size: 0.95rem !important;
        margin-bottom: 1.25rem !important;
    }
    
    .auth-form-container {
        padding: 1rem 0.5rem !important;
        min-height: 65vh !important;
    }
    
    .auth-container .card-body {
        padding: 1.25rem !important;
    }
    
    .auth-container h2 {
        font-size: 1.5rem !important;
    }
    
    .auth-container .text-muted {
        margin-bottom: 1.25rem !important;
    }
    
    .d-flex.justify-content-center.gap-3 {
        gap: 1rem !important;
    }
    
    .display-6 {
        font-size: 1.5rem !important;
    }
}

.auth-container .input-group-text {
    background-color: transparent;
    border-right: none;
    color: #6c5ce7;
}

.auth-container .form-control.is-invalid, 
.auth-container .was-validated .form-control:invalid {
    padding-right: calc(1.5em + 0.75rem);
    background-position: right calc(0.375em + 0.1875rem) center;
}

/* Avatar do usuário */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #6c5ce7 0%, #5649c0 100%);
}
