/* Sistema RN Advocacia - Custom CSS */
/* Visual Jurídico Corporativo */

/* =============================================================================
   CSS Variables - Cores Corporativas
   ============================================================================= */
:root {
    /* Cores primárias - Azul Escuro Jurídico */
    --primary-50: #f0f4f8;
    --primary-100: #d9e2ec;
    --primary-200: #bcccdc;
    --primary-300: #9fb3c8;
    --primary-400: #627d98;
    --primary-500: #1e3a5f;
    --primary-600: #18304f;
    --primary-700: #12253f;
    --primary-800: #0d1b2f;
    --primary-900: #081120;

    /* Cores secundárias - Dourado */
    --secondary-50: #fefbf3;
    --secondary-100: #fdf4de;
    --secondary-200: #fbe9bd;
    --secondary-300: #f7d98f;
    --secondary-400: #e8c255;
    --secondary-500: #c9a227;
    --secondary-600: #b08d1f;
    --secondary-700: #8f7219;
    --secondary-800: #6e5814;
    --secondary-900: #4d3d0e;

    /* Cores de estado */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Backgrounds */
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;
    --bg-card-dark: #1e293b;

    /* Alias para compatibilidade */
    --vinho: var(--primary-500);
    --vinho-light: var(--primary-400);
    --vinho-dark: var(--primary-700);
    --dourado: var(--secondary-500);
    --dourado-light: var(--secondary-400);
    --dourado-dark: var(--secondary-600);
}

/* =============================================================================
   Base Styles
   ============================================================================= */
* {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

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

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

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
    background: #334155;
}

.dark ::-webkit-scrollbar-thumb {
    background: var(--secondary-500);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-400);
}

/* =============================================================================
   Transitions
   ============================================================================= */
.transition-smooth {
    transition: all 0.2s ease-in-out;
}

/* =============================================================================
   Cards
   ============================================================================= */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.dark .card {
    background: #1e293b;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.2);
}

.dark .card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
}

/* Stat cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-500);
}

.stat-card.gold::before {
    background: var(--secondary-500);
}

.stat-card.success::before {
    background: var(--success);
}

.stat-card.danger::before {
    background: var(--danger);
}

.stat-card.warning::before {
    background: var(--warning);
}

/* =============================================================================
   Buttons
   ============================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-500);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-600);
}

.btn-secondary {
    background: var(--secondary-500);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-600);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-500);
    color: var(--primary-500);
}

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

.dark .btn-outline {
    border-color: var(--secondary-500);
    color: var(--secondary-500);
}

.dark .btn-outline:hover {
    background: var(--secondary-500);
    color: var(--primary-900);
}

/* =============================================================================
   Tables
   ============================================================================= */
.table-row-hover:hover {
    background-color: var(--primary-50);
}

.dark .table-row-hover:hover {
    background-color: rgba(30, 58, 95, 0.2);
}

/* =============================================================================
   Forms
   ============================================================================= */
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.dark .form-input {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark .form-input:focus {
    border-color: var(--secondary-500);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.dark .form-label {
    color: #e2e8f0;
}

/* =============================================================================
   Sidebar
   ============================================================================= */
.sidebar-item {
    position: relative;
    transition: all 0.2s ease;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary-500);
    border-radius: 0 3px 3px 0;
}

.dark .sidebar-item.active::before {
    background: var(--secondary-500);
}

/* =============================================================================
   Badges
   ============================================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary-700);
}

.badge-secondary {
    background: var(--secondary-100);
    color: var(--secondary-700);
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* =============================================================================
   Status badges
   ============================================================================= */
.status-nova {
    background-color: #e5e7eb;
    color: #374151;
}

.status-aguardando_despacho {
    background-color: #fef3c7;
    color: #92400e;
}

.status-em_andamento {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-aguardando_retorno {
    background-color: #ffedd5;
    color: #c2410c;
}

.status-concluida {
    background-color: #d1fae5;
    color: #065f46;
}

.status-arquivada {
    background-color: #e2e8f0;
    color: #475569;
}

/* =============================================================================
   Kanban
   ============================================================================= */
.kanban-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(30, 58, 95, 0.15);
}

.dark .kanban-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

/* Priority badges animation */
.priority-badge {
    animation: pulse-subtle 2s infinite;
}

.priority-badge.urgente {
    animation: pulse-urgent 1s infinite;
}

@keyframes pulse-subtle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes pulse-urgent {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* =============================================================================
   Calendar
   ============================================================================= */
.calendar-day {
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background-color: var(--primary-50);
}

.dark .calendar-day:hover {
    background-color: rgba(30, 58, 95, 0.3);
}

.calendar-day.today {
    border: 2px solid var(--primary-500);
}

.dark .calendar-day.today {
    border: 2px solid var(--secondary-500);
}

/* =============================================================================
   Notifications
   ============================================================================= */
.notification-dot {
    animation: notification-pulse 2s infinite;
}

@keyframes notification-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* =============================================================================
   Loading
   ============================================================================= */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* =============================================================================
   Toast Notifications
   ============================================================================= */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background: #10b981;
    color: white;
}

.toast-error {
    background: #ef4444;
    color: white;
}

.toast-warning {
    background: #f59e0b;
    color: white;
}

.toast-info {
    background: var(--primary-500);
    color: white;
}

/* =============================================================================
   Modal
   ============================================================================= */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.dark .modal-content {
    background: #1e293b;
}

/* =============================================================================
   Data Table
   ============================================================================= */
.data-table th {
    background: var(--primary-50);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--primary-700);
}

.dark .data-table th {
    background: rgba(30, 58, 95, 0.3);
    color: var(--secondary-400);
}

/* =============================================================================
   Dropdown
   ============================================================================= */
.dropdown-menu {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    border: 1px solid #e2e8f0;
}

.dark .dropdown-menu {
    background: #1e293b;
    border-color: #334155;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: var(--primary-50);
}

.dark .dropdown-item:hover {
    background: rgba(30, 58, 95, 0.3);
}

/* =============================================================================
   Avatar
   ============================================================================= */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 600;
    background: var(--primary-500);
    color: white;
}

.avatar-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.avatar-md {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 3rem;
    height: 3rem;
    font-size: 1rem;
}

/* =============================================================================
   Empty State
   ============================================================================= */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.dark .empty-state-icon {
    color: #6b7280;
}

/* =============================================================================
   Page Header
   ============================================================================= */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-800);
}

.dark .page-title {
    color: #f1f5f9;
}

/* =============================================================================
   Breadcrumb
   ============================================================================= */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.breadcrumb a {
    color: var(--primary-500);
    transition: color 0.15s ease;
}

.breadcrumb a:hover {
    color: var(--primary-700);
}

.dark .breadcrumb a {
    color: var(--secondary-500);
}

.dark .breadcrumb a:hover {
    color: var(--secondary-400);
}

/* =============================================================================
   Utilities
   ============================================================================= */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--secondary-500), var(--secondary-700));
}

/* =============================================================================
   Print Styles
   ============================================================================= */
@media print {
    .no-print {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }

    body {
        background: white !important;
    }
}
