/* ============================================
   LECTURAS BÍBLICAS - DASHBOARD STYLES
   CSS Moderno y Responsive
   ============================================ */

/* === VARIABLES CSS === */
:root {
    --primary-color: #2c5f7d;
    --primary-dark: #1a3a4d;
    --primary-light: #3d7a9e;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;

    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-dark: #343a40;
    --bg-sidebar: #1a1d21;

    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-light: #adb5bd;
    --text-white: #ffffff;

    --border-color: #dee2e6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;

    --transition: all 0.3s ease;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* === DARK MODE === */
[data-theme="dark"] {
    --primary-color: #4a90b8;
    --primary-dark: #2c5f7d;
    --primary-light: #5ba3c9;
    --secondary-color: #9aa5b1;

    --bg-primary: #1a1d23;
    --bg-secondary: #242831;
    --bg-dark: #2d323d;
    --bg-sidebar: #121418;

    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --text-light: #6c757d;
    --text-white: #f8f9fa;

    --border-color: #3d4452;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
}

/* === LAYOUT PRINCIPAL === */
body:not(.login-page) {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.user-info {
    font-size: 0.85rem;
    color: var(--text-light);
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    margin: 2px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-white);
}

.sidebar-menu li.active a {
    background: var(--primary-color);
    color: var(--text-white);
    border-left: 3px solid var(--primary-light);
}

.sidebar-menu .icon {
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar-menu .divider {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 15px 0;
}

/* === THEME TOGGLE === */
.theme-toggle-item {
    padding: 0;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-white);
}

.theme-toggle .icon {
    font-size: 1.3rem;
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

/* === TOP BAR === */
.top-bar {
    background: var(--bg-secondary);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar h1 {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    margin-right: 15px;
}

.view-controls {
    display: flex;
    gap: 10px;
}

/* === STATS GRID === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 25px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: var(--radius);
}

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

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* === DASHBOARD SECTIONS === */
.dashboard-section {
    padding: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.date-badge {
    background: var(--primary-color);
    color: var(--text-white);
    padding: 5px 15px;
    border-radius: var(--radius);
    font-size: 0.85rem;
}

/* === LECTURAS CARDS === */
.lecturas-list {
    display: grid;
    gap: 15px;
}

.lectura-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.lectura-card:hover {
    box-shadow: var(--shadow);
    transform: translateX(5px);
}

.lectura-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.lectura-header h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.lectura-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 5px 0;
}

.lectura-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* === TIMELINE === */
.lecturas-timeline {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.timeline-day {
    margin-bottom: 20px;
}

.timeline-date {
    background: var(--primary-color);
    color: var(--text-white);
    padding: 8px 15px;
    border-radius: var(--radius);
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.timeline-lecturas {
    display: grid;
    gap: 8px;
    margin-left: 20px;
    border-left: 2px solid var(--border-color);
    padding-left: 20px;
}

.timeline-lectura {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.timeline-lectura:hover {
    background: var(--primary-light);
    color: var(--text-white);
}

.timeline-lectura .ref {
    font-weight: 600;
}

.timeline-lectura .tipo {
    font-size: 0.8rem;
    padding: 3px 10px;
    background: rgba(0,0,0,0.1);
    border-radius: var(--radius-sm);
}

/* === EMPTY STATE === */
.empty-state {
    background: var(--bg-secondary);
    padding: 40px;
    text-align: center;
    border-radius: var(--radius);
    color: var(--text-secondary);
}

.empty-state::before {
    content: '📭';
    display: block;
    font-size: 3rem;
    margin-bottom: 15px;
}

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-info { background: var(--info-color); color: var(--text-white); }
.badge-success { background: var(--success-color); color: var(--text-white); }
.badge-warning { background: var(--warning-color); color: var(--text-dark); }
.badge-danger { background: var(--danger-color); color: var(--text-white); }

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: var(--bg-dark);
}

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

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

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

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* === FORMS === */
.form-group {
    margin-bottom: 15px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font-family);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 125, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* === FILTERS PANEL === */
.filters-panel {
    background: var(--bg-secondary);
    padding: 20px 25px;
    margin: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 15px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.filter-search {
    flex: 1;
    min-width: 250px;
}

.filter-dates {
    flex-wrap: wrap;
    gap: 10px;
}

/* === TABLES === */
.table-container {
    margin: 0 25px 25px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--primary-color);
    color: var(--text-white);
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
}

.data-table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-primary);
}

.text-center {
    text-align: center;
}

/* === PAGINATION === */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    margin-bottom: 15px;
}

.results-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination {
    display: flex;
    gap: 5px;
}

.pagination button {
    padding: 5px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-lg {
    max-width: 800px;
}

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

.modal-header h2 {
    font-size: 1.3rem;
    color: var(--primary-dark);
}

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

.modal-close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
}

/* === ALERTS === */
.alert {
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

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

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

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

/* === LOGIN PAGE === */
.login-page {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form {
    margin-top: 25px;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .dashboard-section {
        padding: 15px;
    }

    .filters-panel {
        margin: 15px;
        padding: 15px;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .table-container {
        margin: 0 15px 15px;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .top-bar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 15px;
    }

    .stat-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .login-box {
        padding: 25px;
    }
}
