/* ==========================================================
   0o1 World – Estilos unificados con Faceslay
   (usa las variables CSS del tema de Faceslay)
   ========================================================== */

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

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary, #0f0e17);
    color: var(--text-primary, #fffffe);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

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

/* ---------- HEADER / NAVBAR (glassmorphism) ---------- */
.header {
    background: var(--bg-glass, rgba(26, 26, 46, 0.85));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color, rgba(42, 58, 94, 0.5));
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header h1 {
    color: var(--accent-primary, #c9a96e);
    font-size: 1.8rem;
    font-weight: 300;
    margin: 0;
}

.header h1 span {
    font-weight: 700;
}

.header .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.header .nav a {
    color: var(--text-secondary, #a7a9be);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 30px;
    transition: all 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
}

.header .nav a:hover {
    background: var(--accent-primary, #c9a96e);
    color: #0f0e17;
    box-shadow: 0 4px 15px rgba(201, 169, 110, 0.3);
    transform: translateY(-2px);
}

.header .nav a.active {
    background: var(--accent-primary, #c9a96e);
    color: #0f0e17;
    box-shadow: 0 4px 15px rgba(201, 169, 110, 0.3);
}

/* ---------- CARDS (glassmorphism) ---------- */
.card {
    background: var(--bg-glass, rgba(26, 26, 46, 0.7));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color, rgba(42, 58, 94, 0.4));
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.card h2 {
    color: var(--accent-primary, #c9a96e);
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color, rgba(42, 58, 94, 0.3));
    padding-bottom: 10px;
}

/* ---------- GRIDS ---------- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- DASHBOARD STAT BOXES ---------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.stat-box {
    background: var(--bg-glass, rgba(22, 33, 62, 0.8));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 10px;
    padding: 15px 20px;
    border: 1px solid var(--border-color, rgba(42, 58, 94, 0.4));
}

.stat-box .stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-primary, #c9a96e);
}

.stat-box .stat-label {
    color: var(--text-secondary, #a7a9be);
    font-size: 0.85rem;
}

.stat-box .stat-sub {
    color: #556688;
    font-size: 0.8rem;
}

.full-width {
    grid-column: 1 / -1;
}

/* ---------- GOAL ITEMS ---------- */
.goal-item {
    background: var(--bg-glass, rgba(26, 42, 68, 0.7));
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    border-left: 3px solid var(--accent-primary, #c9a96e);
}

.goal-item .goal-title {
    color: var(--text-primary, #fffffe);
    font-size: 0.9rem;
}

.goal-item .goal-meta {
    color: var(--text-secondary, #a7a9be);
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 4px;
}

.goal-item .goal-progress {
    background: rgba(15, 14, 23, 0.6);
    border-radius: 4px;
    height: 4px;
    margin-top: 6px;
    overflow: hidden;
}

.goal-item .goal-progress .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary, #c9a96e), #e6c88a);
    border-radius: 4px;
    transition: width 0.8s ease;
}

.goal-item .reward {
    color: #4ecdc4;
    font-weight: 600;
}

.badge-goal {
    display: inline-block;
    background: var(--accent-primary, #c9a96e);
    color: #0f0e17;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ---------- MINI CARDS ---------- */
.mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.mini-card {
    background: var(--bg-glass, rgba(26, 42, 68, 0.6));
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.mini-card .num {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-primary, #c9a96e);
}

.mini-card .label {
    font-size: 0.7rem;
    color: var(--text-secondary, #a7a9be);
}

/* ---------- CHART CONTAINERS ---------- */
.chart-container {
    position: relative;
    height: 200px;
    margin-top: 10px;
}

/* ---------- EVENT CARDS ---------- */
.event-card {
    background: var(--bg-glass, rgba(22, 33, 62, 0.7));
    padding: 14px 18px;
    border-radius: 10px;
    border-left: 4px solid #4ecdc4;
    margin-bottom: 12px;
}

.event-card .event-title {
    font-weight: 600;
    color: var(--text-primary, #fffffe);
    font-size: 1rem;
}

.event-card .event-meta {
    color: var(--text-secondary, #a7a9be);
    font-size: 0.85rem;
    margin-top: 4px;
}

.event-card .event-desc {
    color: #8899bb;
    font-size: 0.9rem;
    margin-top: 4px;
}

.event-card .status-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-top: 6px;
}

.event-card .status-badge.pending { background: #f9a825; color: #0f0e17; }
.event-card .status-badge.accepted { background: #4caf50; color: #0f0e17; }
.event-card .status-badge.completed { background: rgba(42, 58, 94, 0.6); color: #a7a9be; }
.event-card .status-badge.cancelled { background: #e53935; color: #fff; }
.event-card .status-badge.rejected { background: #e53935; color: #fff; }

/* ---------- CITIZEN CARDS ---------- */
.citizen-card {
    background: var(--bg-glass, rgba(22, 33, 62, 0.7));
    padding: 16px 20px;
    border-radius: 10px;
    border-left: 4px solid var(--accent-primary, #c9a96e);
    transition: transform 0.2s, box-shadow 0.2s;
}

.citizen-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.citizen-card .name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary, #fffffe);
}

.citizen-card .profession {
    color: var(--text-secondary, #a7a9be);
    font-size: 0.9rem;
}

.citizen-card .mood {
    display: inline-block;
    background: rgba(42, 58, 94, 0.6);
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--accent-primary, #c9a96e);
    margin-top: 6px;
}

.citizen-card .action {
    color: var(--text-secondary, #a7a9be);
    font-size: 0.85rem;
    margin-top: 4px;
}

.citizen-card .link {
    display: inline-block;
    margin-top: 10px;
    color: var(--accent-primary, #c9a96e);
    text-decoration: none;
    font-size: 0.85rem;
}

.citizen-card .link:hover {
    text-decoration: underline;
}

/* ---------- NOTIFICATIONS (toast) ---------- */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: var(--bg-glass, rgba(26, 26, 46, 0.9));
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color, rgba(42, 58, 94, 0.5));
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--accent-primary, #c9a96e);
    transition: opacity 0.3s;
}

.notification .notif-title {
    font-weight: 600;
    color: var(--accent-primary, #c9a96e);
    font-size: 0.95rem;
}

.notification .notif-body {
    color: var(--text-secondary, #a7a9be);
    font-size: 0.85rem;
    margin-top: 4px;
}

.notification.goal_completed { border-left-color: #4caf50; }
.notification.loan_received { border-left-color: #ff9800; }
.notification.loan_given { border-left-color: #ff9800; }
.notification.job_completed { border-left-color: #4ecdc4; }
.notification.job_paid { border-left-color: #4ecdc4; }
.notification.subsidy { border-left-color: #e91e63; }

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

/* ---------- NOTIFICATION BADGE (navbar) ---------- */
.notification-badge {
    display: inline-block;
    background: #e53935;
    color: #fff;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 6px;
    min-width: 18px;
    text-align: center;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ---------- TAGS & BADGES ---------- */
.tag {
    display: inline-block;
    background: rgba(42, 58, 94, 0.6);
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--accent-primary, #c9a96e);
    margin: 2px 4px 2px 0;
}

.badge-success { color: #4caf50; }
.badge-warning { color: #f9a825; }

/* ---------- MODALS (glassmorphism) ---------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-glass, rgba(26, 26, 46, 0.95));
    backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 25px 30px;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border-color, rgba(42, 58, 94, 0.5));
    color: var(--text-primary, #fffffe);
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    color: var(--accent-primary, #c9a96e);
    margin-top: 0;
}

.modal-content label {
    display: block;
    margin-top: 12px;
    color: var(--text-secondary, #a7a9be);
    font-size: 0.9rem;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color, rgba(42, 58, 94, 0.6));
    background: rgba(22, 33, 62, 0.8);
    color: var(--text-primary, #fffffe);
    margin-top: 4px;
}

.modal-content .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.modal-content .form-actions button {
    padding: 8px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.modal-content .form-actions .submit {
    background: var(--accent-primary, #c9a96e);
    color: #0f0e17;
}

.modal-content .form-actions .cancel {
    background: rgba(42, 58, 94, 0.6);
    color: var(--text-secondary, #a7a9be);
}

.close-modal {
    float: right;
    background: none;
    border: none;
    color: var(--text-secondary, #a7a9be);
    font-size: 1.5rem;
    cursor: pointer;
}
.close-modal:hover { color: var(--text-primary, #fffffe); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .header .nav a {
        margin-left: 0;
        margin-right: 10px;
    }
}

/* ---------- SCROLLBAR (estilo Faceslay) ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 14, 23, 0.5);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-primary, #c9a96e);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #b8941f;
}

/* ---------- BOTONES DE ACCIÓN (estilo Faceslay) ---------- */
.btn-primary {
    background: linear-gradient(145deg, #ffe600, #ffb347);
    box-shadow: 0 8px 0 #b37400, 0 4px 15px rgba(255, 215, 0, 0.3);
    color: #1a1a1a;
    border: none;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #b37400, 0 8px 25px rgba(255, 215, 0, 0.5);
}

.btn-secondary {
    background: linear-gradient(145deg, #8a2be2, #b266ff);
    box-shadow: 0 8px 0 #5a1e8a, 0 4px 15px rgba(138, 43, 226, 0.3);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #5a1e8a, 0 8px 25px rgba(138, 43, 226, 0.5);
}

/* Botón de regreso a Faceslay (estilo destacado) */
.nav-btn-home {
    background: linear-gradient(145deg, #ffe600, #ffb347) !important;
    box-shadow: 0 4px 0 #b37400, 0 4px 15px rgba(255, 215, 0, 0.3) !important;
    color: #1a1a1a !important;
    font-weight: 700 !important;
    border-radius: 30px !important;
    padding: 8px 18px !important;
    transition: all 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.nav-btn-home:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 0 #b37400, 0 8px 25px rgba(255, 215, 0, 0.5) !important;
    background: linear-gradient(145deg, #ffd700, #ffa500) !important;
}

.nav-btn-home i {
    color: #1a1a1a;
}