/* ================================================
   STYLES-BOOTSTRAP.CSS - Diseño personalizado
   ================================================ */

:root {
    --primary-color: #28a745;
    --primary-dark: #218838;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-color: #212529;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow-md: 0 .5rem 1rem rgba(0,0,0,.15);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,.175);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* ================================================
   HEADER GRADIENT
   ================================================ */
.header-gradient {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.header-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.header-gradient h1 {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.stats-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
}

/* ================================================
   BADGES Y PILLS
   ================================================ */
.badge {
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    letter-spacing: 0.5px;
}

/* ================================================
   CARDS Y SECCIONES
   ================================================ */
.card {
    border-radius: 1rem;
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    border-radius: 1rem 1rem 0 0 !important;
    border-bottom: none;
    font-weight: 600;
}

.section-header {
    position: relative;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.section-header h4 {
    font-weight: 700;
    display: flex;
    align-items: center;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.75rem;
}

/* ================================================
   INPUTS Y FORMULARIOS
   ================================================ */
.form-label {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control,
.form-select {
    border-radius: 0.5rem;
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.input-group-text {
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-right: none;
    border-radius: 0.5rem 0 0 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.input-group .form-control,
.input-group .form-select {
    border-left: none;
}

.input-group:focus-within .input-group-text {
    border-color: var(--primary-color);
    background: rgba(13, 110, 253, 0.05);
}

/* Estados de validación */
.is-invalid {
    border-color: var(--danger-color) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.75rem) center;
    background-size: calc(0.75em + 0.75rem) calc(0.75em + 0.75rem);
    padding-right: calc(1.5em + 1.5rem);
}

.invalid-feedback {
    display: block;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    color: var(--danger-color);
    font-weight: 500;
}

.form-text {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.form-text.help-error {
    color: var(--danger-color);
    font-weight: 600;
}

.form-text.help-ok {
    color: var(--success-color);
    font-weight: 600;
}

.form-text.help-muted {
    color: #6c757d;
}

/* ================================================
   CHECKBOXES Y RADIOS
   ================================================ */
.form-check {
    padding-left: 1.8rem;
    margin-bottom: 0.75rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    margin-left: -1.8rem;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.form-check-label {
    cursor: pointer;
    user-select: none;
    font-size: 1rem;
}

/* ================================================
   BOTONES
   ================================================ */
.btn {
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

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

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* ================================================
   ALERTAS
   ================================================ */
.alert {
    border-radius: 1rem;
    border: none;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

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

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

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

.alert-heading {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.alert ul {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.alert li {
    margin-bottom: 0.25rem;
}

/* ================================================
   SEPARADORES
   ================================================ */
hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    margin: 2rem 0;
}

/* ================================================
   FOOTER
   ================================================ */
footer {
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

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

.card,
.alert {
    animation: fadeIn 0.5s ease-out;
}

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

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

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

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

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .header-gradient h1 {
        font-size: 2rem;
    }
    
    .stats-card {
        margin-top: 1.5rem;
        padding: 1.5rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

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

.fw-bold {
    font-weight: 700 !important;
}

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

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

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

/* ================================================
   FILE INPUT - BADGE ARCHIVO CARGADO
   ================================================ */
.file-loaded {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mejorar apariencia de inputs file */
input[type="file"] {
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

/* ================================================
   DOCUMENTOS CARGADOS - RESALTADO
   ================================================ */
.doc-uploaded {
    position: relative;
}

.doc-uploaded::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 8px;
    z-index: -1;
    opacity: 0.5;
    animation: pulseGreen 2s ease-in-out infinite;
}

@keyframes pulseGreen {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.5;
    }
}

.border-success {
    border-color: #28a745 !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

.badge.bg-success {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    animation: fadeInScale 0.3s ease-out;
}
