/* ==================== ROOT & GLOBAL STYLES ==================== */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    
    --transition-speed: 0.3s;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 2rem rgba(0, 0, 0, 0.15);
    
    --border-radius: 0.375rem;
}

* {
    transition: all var(--transition-speed) ease;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-color);
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: linear-gradient(135deg, #1a1e27 0%, #2c3e50 100%) !important;
    border-bottom: 3px solid var(--primary-color);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.navbar-brand i {
    margin-right: 0.5rem;
    color: var(--info-color);
}

/* ==================== HERO CARD ==================== */
.hero-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1rem;
}

.hero-card .card-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-card .card-text {
    font-size: 1.1rem;
    opacity: 0.95;
}

.hero-card i {
    margin-right: 0.5rem;
    color: var(--info-color);
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
    box-shadow: var(--shadow-sm);
}

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

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0a58ca 0%, #0845ad 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%);
    border: none;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #146c43 0%, #0d3a1a 100%);
}

.btn-success:disabled {
    background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%);
    color: white;
    opacity: 0.9;
}

/* ==================== CARDS ==================== */
.card {
    background: white;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
}

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

.card-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #e9ecef;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* ==================== STAT CARDS ==================== */
.stat-card {
    border-radius: 1rem;
    overflow: hidden;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* ==================== TABLES ==================== */
.table {
    margin-bottom: 0;
}

.table thead {
    background: var(--dark-color);
    color: white;
}

.table thead th {
    font-weight: 600;
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* ==================== BADGES ==================== */
.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 0.25rem;
}

.badge-action {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
}

/* ==================== PROGRESS BAR ==================== */
.progress {
    height: 1.5rem;
    border-radius: 0.5rem;
    background-color: #e9ecef;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--info-color) 100%);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* ==================== TICKET CARDS ==================== */
.ticket-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
}

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

.ticket-card.processed {
    border-left: 4px solid var(--success-color);
    background: linear-gradient(135deg, white 0%, #f1f3f5 100%);
}

.ticket-card.processing {
    border-left: 4px solid var(--info-color);
    opacity: 0.7;
}

.ticket-id {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.ticket-status {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.ticket-status.pending {
    background-color: #e7f3ff;
    color: var(--primary-color);
}

.ticket-status.processing {
    background-color: #fff3cd;
    color: #856404;
}

.ticket-status.success {
    background-color: #d1e7dd;
    color: var(--success-color);
}

/* ==================== FORMS ==================== */
.form-control,
.form-select {
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all var(--transition-speed) ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* ==================== ALERTS ==================== */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.25rem;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.alert-info {
    background-color: #cfe2ff;
    color: #084298;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== MODALS ==================== */
.modal-content {
    border-radius: 1rem;
    background: white;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    color: white;
    border-radius: 1rem 1rem 0 0;
    border: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ==================== AUDIT LOG ==================== */
.audit-entry {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    background-color: white;
    border-left: 3px solid var(--primary-color);
}

.audit-entry:last-child {
    border-bottom: none;
}

.audit-entry:hover {
    background-color: #f8f9fa;
}

.audit-timestamp {
    font-size: 0.85rem;
    color: var(--gray-color);
}

.audit-message {
    font-weight: 500;
    color: var(--dark-color);
}

/* ==================== UTILITY CLASSES ==================== */
.text-primary-light {
    color: #0d6efd;
}

.text-success-light {
    color: #198754;
}

.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .hero-card .card-title {
        font-size: 1.75rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .container-fluid {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .hero-card .card-title {
        font-size: 1.5rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

.slide-up {
    animation: slideUp 0.3s ease;
}

/* ==================== LOADING STATE ==================== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    width: 2rem;
    height: 2rem;
    display: inline-block;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #0a58ca;
}
