/* ===================================
   ABRACE - Sistema de Avaliação de Competências
   Estilos Customizados
   =================================== */

:root {
    --primary-color: #1e4d72;
    --primary-light: #2a5d84;
    --primary-dark: #153a54;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    --transition: all 0.3s ease;
}

/* ===================================
   BASE STYLES
   =================================== */

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f8f9fa;
}

.container, .container-fluid {
    position: relative;
}

/* ===================================
   TYPOGRAPHY
   =================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 700;
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    border-radius: var(--border-radius);
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

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

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

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #fd7e14 100%);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
}

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

/* ===================================
   CARDS
   =================================== */

.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
}

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

.card-header {
    background: linear-gradient(135deg, var(--light-color) 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.card-body {
    padding: 1.25rem;
}

/* ===================================
   NAVBAR
   =================================== */

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-dark .navbar-brand {
    color: white !important;
}

.navbar-dark .navbar-text {
    font-weight: 500;
}

/* ===================================
   FORMS
   =================================== */

.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    transition: var(--transition);
    padding: 0.5rem 0.75rem;
}

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

.form-control-sm, .form-select-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* ===================================
   TABLES
   =================================== */

.table {
    --bs-table-hover-bg: rgba(30, 77, 114, 0.05);
}

.table th {
    font-weight: 600;
    background-color: var(--light-color);
    border-bottom: 2px solid #dee2e6;
}

/* ===================================
   BADGES
   =================================== */

.badge {
    font-size: 0.75em;
    padding: 0.375em 0.75em;
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* ===================================
   ALERTS
   =================================== */

.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f1aeb5 100%);
    color: #721c24;
}

/* ===================================
   PROGRESS BARS
   =================================== */

.progress {
    height: 10px;
    border-radius: var(--border-radius);
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    transition: width 0.6s ease;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

/* ===================================
   MODALS
   =================================== */

.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--light-color) 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* ===================================
   CUSTOM COMPONENTS
   =================================== */

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.avatar-circle {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2em;
}

.avatar-large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto;
}

.hover-card {
    transition: var(--transition);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    padding: 1rem;
}

.hover-card:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.stats-card {
    text-align: center;
    padding: 1rem;
    border-radius: var(--border-radius);
}

.info-box {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

/* ===================================
   FORMULÁRIO DE AVALIAÇÃO
   =================================== */

.competencia-categoria {
    border-bottom: 2px solid #e9ecef;
}

.categoria-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #dee2e6;
}

.competencia-item {
    transition: background-color 0.2s ease;
}

.competencia-item:hover {
    background-color: #f8f9fa;
}

.competencia-text {
    line-height: 1.4;
    font-size: 0.9rem;
    padding-right: 1rem;
}

.media-categoria {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-bottom: 1px solid #dee2e6;
}

.media-geral {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.media-display, .media-geral-display {
    min-width: 60px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
}

.avaliacao-input, .evidencia-input {
    transition: var(--transition);
}

.avaliacao-input:focus, .evidencia-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(30, 77, 114, 0.25);
}

/* ===================================
   LIST GROUPS
   =================================== */

.list-group-item {
    border: none;
    border-bottom: 1px solid #dee2e6;
    transition: var(--transition);
}

.list-group-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

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

/* ===================================
   LOADING STATES
   =================================== */

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

#loading-overlay {
    backdrop-filter: blur(4px);
}

/* ===================================
   ANIMATIONS
   =================================== */

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

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

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* ===================================
   UTILITIES
   =================================== */

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
}

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

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

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

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem !important;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .competencia-text {
        font-size: 0.8rem;
    }
    
    .col-md-4, .col-md-2, .col-md-6 {
        margin-bottom: 0.5rem;
    }
    
    .btn {
        padding: 0.375rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1.5rem;
        font-size: 1rem;
    }
    
    .avatar-large {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .stats-card h3 {
        font-size: 1.5rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-header, .card-body {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.25rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .form-control, .form-select {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .competencia-item .row > div {
        margin-bottom: 0.5rem;
    }
    
    .hero-section .row > div {
        margin-bottom: 1rem;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    .navbar, .btn, .alert, .modal, #loading-overlay {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
    
    .bg-primary, .bg-success, .bg-warning, .bg-info {
        background: white !important;
        color: black !important;
        border: 1px solid #dee2e6 !important;
    }
    
    body {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .competencia-text {
        font-size: 10px;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus, .btn:focus, input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark-color);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* ===================================
   DARK MODE (OPCIONAL)
   =================================== */

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --bs-body-bg: #212529;
        --bs-body-color: #adb5bd;
    }
}

[data-theme="dark"] {
    --bs-body-bg: #212529;
    --bs-body-color: #adb5bd;
    
    .card {
        background-color: #343a40;
        color: #adb5bd;
    }
    
    .form-control, .form-select {
        background-color: #495057;
        border-color: #6c757d;
        color: #fff;
    }
    
    .table {
        --bs-table-bg: #343a40;
        --bs-table-color: #adb5bd;
    }
}

/* ===================================
   END OF STYLES
   =================================== */