/**
 * Estilos principales de la aplicacion
 * Colores: Verde #27ae60, Gris #555, Blanco #fff
 * Responsive design con Bootstrap 5
 */

:root {
    --primary-color: #27ae60;
    --primary-dark: #1e8449;
    --primary-light: #52be80;
    --secondary-color: #555555;
    --secondary-light: #757575;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --light-bg: #ffffff;
    --light-gray: #f5f5f5;
    --dark-text: #333333;
    --medium-text: #555555;
    --light-text: #888888;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-text);
    background-color: var(--light-gray);
    font-size: 14px;
    line-height: 1.6;
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark-text);
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    color: var(--medium-text);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Container Bootstrap customizado */
.container, .container-fluid {
    background-color: var(--light-bg);
}

/* Botones */
.btn {
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
    box-shadow: 0 0 0 0.25rem rgba(39, 174, 96, 0.25);
}

.btn-primary:active {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

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

.btn-secondary:hover, .btn-secondary:focus {
    background-color: var(--secondary-light);
    border-color: var(--secondary-light);
    color: white;
}

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

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

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Tarjetas */
.card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    background-color: var(--light-bg);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

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

.card-header {
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--dark-text);
}

.card-title {
    color: var(--dark-text);
    font-weight: 600;
}

.card-text {
    color: var(--medium-text);
}

/* Alertas */
.alert {
    border-radius: 6px;
    border: none;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Formularios */
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    color: var(--dark-text);
    background-color: var(--light-bg);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(39, 174, 96, 0.25);
    color: var(--dark-text);
    background-color: var(--light-bg);
}

.form-label {
    color: var(--dark-text);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-text {
    color: var(--light-text);
    font-size: 0.875rem;
}

/* Tablas */
.table {
    background-color: var(--light-bg);
    border-collapse: collapse;
}

.table thead {
    background-color: var(--light-gray);
    color: var(--dark-text);
}

.table th {
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--dark-text);
}

.table td {
    border-bottom: 1px solid var(--border-color);
    color: var(--medium-text);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: var(--light-gray);
}

/* Navbar */
.navbar {
    background-color: var(--light-bg);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-link {
    color: var(--dark-text) !important;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
}

/* Footer */
footer {
    background-color: var(--light-gray);
    color: var(--medium-text);
}

footer a {
    color: var(--primary-color);
}

footer a:hover {
    color: var(--primary-dark);
}

/* Badge */
.badge {
    padding: 0.35rem 0.65rem;
    font-weight: 500;
}

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

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

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

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

/* Progress bar */
.progress {
    background-color: var(--light-gray);
    height: 24px;
    border-radius: 4px;
}

.progress-bar {
    background-color: var(--primary-color);
    transition: width 0.6s ease;
    font-size: 12px;
    line-height: 24px;
}

/* Estilos personalizados */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.stat-card h3 {
    color: white;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Modal */
.modal-content {
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.modal-header {
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--border-color);
}

.modal-header .modal-title {
    color: var(--dark-text);
    font-weight: 600;
}

.modal-footer {
    background-color: var(--light-gray);
    border-top: 1px solid var(--border-color);
}

/* Dropdown */
.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: 6px;
}

.dropdown-item {
    color: var(--dark-text);
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.dropdown-divider {
    border-color: var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    table {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .container, .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .card {
        margin-bottom: 0.75rem;
    }
}

/* ====== NOTIFICACIONES ====== */

.notification-container {
    position: fixed;
    z-index: 9998;
    pointer-events: none;
}

.notification-container.notification-top-right {
    top: 1rem;
    right: 1rem;
}

.notification-container.notification-top-left {
    top: 1rem;
    left: 1rem;
}

.notification-container.notification-bottom-right {
    bottom: 1rem;
    right: 1rem;
}

.notification-container.notification-bottom-left {
    bottom: 1rem;
    left: 1rem;
}

.notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    max-width: 400px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    background-color: white;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    pointer-events: all;
    animation: slideIn 0.3s ease-in-out;
    word-wrap: break-word;
}

.notification-content {
    flex: 1;
    margin-right: 1rem;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.notification-message {
    font-size: 0.875rem;
    color: var(--medium-text);
    line-height: 1.4;
}

.notification-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--light-text);
    font-size: 1.25rem;
    padding: 0;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: var(--dark-text);
}

.notification-hide {
    animation: slideOut 0.3s ease-in-out forwards;
}

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

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

/* Estados de notificaciones */
.notification-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.notification-success .notification-title {
    color: #155724;
}

.notification-success .notification-message {
    color: #155724;
}

.notification-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.notification-danger .notification-title {
    color: #721c24;
}

.notification-danger .notification-message {
    color: #721c24;
}

.notification-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.notification-warning .notification-title {
    color: #856404;
}

.notification-warning .notification-message {
    color: #856404;
}

.notification-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.notification-info .notification-title {
    color: #0c5460;
}

.notification-info .notification-message {
    color: #0c5460;
}

/* Notificaciones en modo oscuro */
body.dark-mode .notification {
    background-color: #242424;
    border-color: #3a3a3a;
}

body.dark-mode .notification-success {
    background-color: #1e5631;
    border-color: #2d7d3e;
}

body.dark-mode .notification-success .notification-title,
body.dark-mode .notification-success .notification-message {
    color: #87d993;
}

body.dark-mode .notification-danger {
    background-color: #6e1f1f;
    border-color: #8b2a2a;
}

body.dark-mode .notification-danger .notification-title,
body.dark-mode .notification-danger .notification-message {
    color: #ff8787;
}

body.dark-mode .notification-warning {
    background-color: #664d00;
    border-color: #995c00;
}

body.dark-mode .notification-warning .notification-title,
body.dark-mode .notification-warning .notification-message {
    color: #ffd700;
}

body.dark-mode .notification-info {
    background-color: #1a3d4d;
    border-color: #2d5a73;
}

body.dark-mode .notification-info .notification-title,
body.dark-mode .notification-info .notification-message {
    color: #87ceeb;
}

/* Responsive para notificaciones */
@media (max-width: 768px) {
    .notification {
        min-width: 280px;
        max-width: 90vw;
    }
    
    .notification-container.notification-top-right,
    .notification-container.notification-bottom-right {
        right: 0.5rem;
    }
    
    .notification-container.notification-top-left,
    .notification-container.notification-bottom-left {
        left: 0.5rem;
    }
}
