/* ============================================================
   Estilos Principales - Sistema de Gestión Bíblica
   ============================================================ */

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-bg: #1f2937;
    --light-bg: #f3f4f6;
    --border-color: #e5e7eb;
    --text-dark: #111827;
    --text-light: #6b7280;
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

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

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

/* ============================================================
   NAVEGACIÓN
   ============================================================ */

.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 1rem 2rem;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-brand-icon {
    font-size: 2rem;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    opacity: 0.8;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    color: white;
    text-align: right;
}

.user-name {
    font-weight: bold;
}

.user-role {
    font-size: 0.85rem;
    opacity: 0.9;
}

.btn-logout {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
}

.btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ============================================================
   CONTENEDOR PRINCIPAL
   ============================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.container-fluid {
    max-width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================================
   GRID LAYOUT
   ============================================================ */

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ============================================================
   TARJETAS
   ============================================================ */

.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: var(--light-bg);
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.card-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.card-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ============================================================
   BOTONES
   ============================================================ */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background-color: #1e40af;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background-color: #6d28d9;
}

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

.btn-success:hover {
    background-color: #059669;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

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

.btn-warning:hover {
    background-color: #d97706;
}

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

.btn-info:hover {
    background-color: #2563eb;
}

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

.btn-block {
    width: 100%;
    display: block;
}

.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* ============================================================
   FORMULARIOS
   ============================================================ */

.form-group {
    margin-bottom: 1.5rem;
}

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

.label-required::after {
    content: " *";
    color: var(--danger-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="telephone"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="telephone"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.form-row-full {
    grid-column: 1 / -1;
}

/* ============================================================
   TABLAS
   ============================================================ */

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: var(--box-shadow);
    border-radius: 0.5rem;
    overflow: hidden;
}

thead {
    background-color: var(--primary-color);
    color: white;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

tbody tr:hover {
    background-color: var(--light-bg);
}

tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-table {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

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

.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-color: var(--success-color);
}

.alert-danger {
    background-color: #fee2e2;
    color: #7f1d1d;
    border-color: var(--danger-color);
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-color: var(--warning-color);
}

.alert-info {
    background-color: #dbeafe;
    color: #0c2340;
    border-color: var(--info-color);
}

/* ============================================================
   MODAL
   ============================================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ============================================================
   PROGRESO
   ============================================================ */

.progress-bar {
    width: 100%;
    height: 24px;
    background-color: var(--light-bg);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    transition: width 0.3s ease;
}

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

.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background-color: #dbeafe;
    color: #0c2340;
}

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

.badge-danger {
    background-color: #fee2e2;
    color: #7f1d1d;
}

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

/* ============================================================
   PÁGINA DE LOGIN
   ============================================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-box h1 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-box p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.login-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.login-tab {
    flex: 1;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    color: var(--text-light);
    font-weight: 500;
}

.login-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ============================================================
   DASHBOARD
   ============================================================ */

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    color: var(--text-light);
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--box-shadow);
    border-left: 4px solid;
}

.stat-card.primary {
    border-color: var(--primary-color);
}

.stat-card.success {
    border-color: var(--success-color);
}

.stat-card.warning {
    border-color: var(--warning-color);
}

.stat-card.danger {
    border-color: var(--danger-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-weight: 500;
}

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

@media (max-width: 768px) {
    .navbar-menu {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.9rem;
    }

    .container {
        padding: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .login-box {
        padding: 2rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.75rem;
    }

    .table-actions {
        flex-wrap: wrap;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-menu {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .nav-user {
        flex-direction: column;
        width: 100%;
    }

    .login-box {
        padding: 1.5rem;
        max-width: 95%;
    }

    .stat-cards {
        grid-template-columns: 1fr;
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 95%;
    }
}
