/* public/css/style.css */

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --text-dark: #2b2d42;
    --text-light: #8d99ae;
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --shadow: 0 10px 30px -10px rgba(0,0,0,0.08);
    --radius: 16px;
    
    /* Cores Sociais */
    --facebook: #1877f2; 
    --github: #24292e;
}

.dark-mode {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --text-dark: #e0e0e0;
    --text-light: #a0a0a0;
    --shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }

body {
    background-color: var(--bg-body);
    color: var(--text-dark);
    transition: all 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex-grow: 1; padding: 40px 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* --- HEADER & NAV --- */
header { background: var(--bg-card); padding: 1.2rem 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
/* Logo Imagem */
.brand-logo { height: 30px; width: auto; }

nav ul { display: flex; list-style: none; gap: 30px; }
nav a { color: var(--text-light); text-decoration: none; font-weight: 600; transition: 0.3s; position: relative; }
nav a:hover, nav a.active { color: var(--primary); }
nav a.active::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 100%; height: 3px; background: var(--primary); border-radius: 2px; }

/* --- USER ACTIONS & MENU --- */
.user-actions { display: flex; align-items: center; gap: 20px; }
.theme-toggle { background: none; border: none; color: var(--text-dark); font-size: 1.2rem; cursor: pointer; }

.user-menu { position: relative; cursor: pointer; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-dropdown { position: absolute; top: 50px; right: 0; background: var(--bg-card); padding: 10px; border-radius: 12px; box-shadow: var(--shadow); width: 220px; display: none; z-index: 1000; }
.user-menu:hover .user-dropdown { display: block; }

.user-details { padding: 10px 15px; border-bottom: 1px solid rgba(0,0,0,0.05); margin-bottom: 5px; }
.user-details strong { display: block; font-size: 0.95rem; }
.user-details small { color: var(--text-light); font-size: 0.8rem; word-break: break-all; }

.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 15px; color: var(--text-dark); text-decoration: none; border-radius: 8px; transition: 0.2s; font-size: 0.9rem; cursor: pointer; }
.dropdown-item:hover { background: var(--bg-body); color: var(--primary); }
.dropdown-item.logout { color: var(--danger); }
.dropdown-divider { height: 1px; background: rgba(0,0,0,0.05); margin: 5px 0; }

.show-when-logged-out, .show-when-logged-in { transition: all 0.3s; }

/* --- COMPONENTS (Buttons, Cards, Inputs) --- */
.btn { padding: 10px 20px; border: none; border-radius: 12px; cursor: pointer; font-weight: 600; transition: transform 0.2s, box-shadow 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.95rem; }
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.btn-primary { background: linear-gradient(45deg, var(--primary), var(--secondary)); color: white; box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline.btn-header { border: 1px solid var(--text-dark); color: var(--text-dark); padding: 8px 16px; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; }
.btn-icon { width: 32px; height: 32px; border-radius: 50%; padding: 0; display: flex; align-items: center; justify-content: center; color: var(--text-light); background: transparent; transition: 0.2s; cursor: pointer; border: 1px solid transparent; }
.btn-icon:hover { background: var(--bg-body); color: var(--primary); }
.btn-icon.delete:hover { color: var(--danger); background: rgba(247, 37, 133, 0.1); }

.card { background: var(--bg-card); border-radius: var(--radius); padding: 25px; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.05); position: relative; overflow: hidden; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-title { font-size: 1.2rem; font-weight: 700; color: var(--text-dark); }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px; border: 1px solid rgba(0,0,0,0.1); border-radius: 10px; background: var(--bg-body); color: var(--text-dark); outline: none; font-size: 1rem; transition: 0.3s; }
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* --- DASHBOARD & STATS --- */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 25px; margin-bottom: 30px; }
.stat-card { display: flex; flex-direction: column; justify-content: space-between; min-height: 160px; }
.stat-card.balance { background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%); color: white; }
.stat-card.income { background: linear-gradient(135deg, #4cc9f0 0%, #4895ef 100%); color: white; }
.stat-card.expense { background: linear-gradient(135deg, #f72585 0%, #b5179e 100%); color: white; }

.stat-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.stat-title { font-size: 0.9rem; font-weight: 700; text-transform: uppercase; opacity: 0.9; letter-spacing: 0.5px; }
.stat-icon { font-size: 1.5rem; opacity: 0.8; background: rgba(255,255,255,0.2); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
.stat-value { font-size: 2.2rem; font-weight: 800; margin-bottom: 5px; }
.stat-desc { font-size: 0.85rem; opacity: 0.8; }

/* Card Pro (Dashboard) */
.card.card-pro { background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%); color: #212529; cursor: pointer; transition: transform 0.3s; border: none; }
.card.card-pro:hover { transform: scale(1.03); box-shadow: 0 15px 30px rgba(255, 152, 0, 0.3); }
.card.card-pro .btn-pro { background: #212529; color: #FFC107; border: none; width: 100%; border-radius: 30px; text-transform: uppercase; letter-spacing: 1px; margin-top: auto; }
.card.card-pro .stat-icon { background: rgba(0,0,0,0.1); color: #212529; }

/* --- QUICK ACTIONS --- */
.quick-actions { display: flex; gap: 15px; margin-bottom: 30px; }
.action-btn { flex: 1; background: var(--bg-card); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; gap: 15px; cursor: pointer; transition: 0.3s; border: 2px solid transparent; }
.action-btn:hover { border-color: var(--primary); transform: translateY(-3px); }
.action-btn i { font-size: 1.5rem; color: var(--primary); }
.action-btn span { font-weight: 700; color: var(--text-dark); }

/* --- TABLES --- */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 0.9rem; }
thead { background: rgba(0,0,0,0.02); border-bottom: 1px solid rgba(0,0,0,0.05); }
th { padding: 15px 20px; text-align: left; color: var(--text-light); font-weight: 700; text-transform: uppercase; font-size: 0.8rem; }
td { padding: 15px 20px; color: var(--text-dark); border-bottom: 1px solid rgba(0,0,0,0.05); vertical-align: middle; }
tr:hover td { background: rgba(0,0,0,0.01); }

.amount-pos { color: var(--success); font-weight: 700; }
.amount-neg { color: var(--danger); font-weight: 700; }
.category-badge { padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; background: rgba(67, 97, 238, 0.1); color: var(--primary); }

/* --- 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-card); padding: 30px; border-radius: var(--radius); width: 90%; max-width: 500px; box-shadow: var(--shadow); animation: fadeIn 0.3s; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-light); }

/* --- TOAST --- */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 3000; }
.toast { background: var(--bg-card); padding: 15px 20px; border-radius: 10px; margin-bottom: 10px; border-left: 5px solid var(--primary); box-shadow: 0 10px 30px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 12px; font-weight: 500; animation: slideIn 0.3s ease; }
.toast-success { border-left-color: var(--success); }
.toast-danger { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }

/* --- FOOTER --- */
footer { background: var(--bg-card); padding: 40px 0 20px; margin-top: 60px; border-top: 1px solid rgba(0,0,0,0.05); }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-section h3 { margin-bottom: 20px; font-size: 1.1rem; color: var(--text-dark); }
.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 10px; }
.footer-section a { color: var(--text-light); text-decoration: none; transition: 0.2s; }
.footer-section a:hover { color: var(--primary); }
.copyright { text-align: center; padding-top: 20px; border-top: 1px solid rgba(0,0,0,0.05); color: var(--text-light); font-size: 0.9rem; }

/* --- ANIMATIONS --- */
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.skeleton { background: #eee; height: 20px; border-radius: 4px; animation: pulse 1.5s infinite; width: 100%; }
@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }

/* Responsivo Geral */
@media (max-width: 768px) {
    .header-content { flex-direction: column; gap: 15px; }
    nav ul { gap: 15px; font-size: 0.9rem; flex-wrap: wrap; justify-content: center; }
    .quick-actions { flex-direction: column; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}