/* css/styles.css */
:root {
    --bg-color: #0F172A;
    --surface-color: rgba(30, 41, 59, 0.7);
    --surface-border: rgba(255, 255, 255, 0.1);
    --primary-color: #8B5CF6;
    --primary-hover: #7C3AED;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --glass-blur: blur(16px);
    --border-radius: 16px;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--surface-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    color: var(--text-secondary);
}

.danger-text {
    color: var(--danger) !important;
}

.success-text {
    color: var(--success) !important;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.btn-text:hover {
    color: var(--primary-hover);
}

/* Layout Setup */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 3rem;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-links li {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.nav-links li:hover,
.nav-links li.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--surface-border);
}

.user-profile img,
.mobile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-profile .name {
    color: var(--text-primary);
    font-weight: 600;
}

.user-profile .plan {
    font-size: 0.8rem;
    color: var(--primary-color);
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.15), transparent 40%),
        radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.05), transparent 40%);
    min-height: 100vh;
}

/* Mobile Header & Bottom Nav hidden on Desktop */
.mobile-header,
.bottom-nav {
    display: none;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view.active-view {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-desktop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Metrics Cards */
.balance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-hero {
    margin-bottom: 1.5rem;
}

.card-hero p {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.card-hero h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.card-footer {
    display: flex;
    gap: 1.5rem;
    border-top: 1px solid var(--surface-border);
    padding-top: 1rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.stat.income i {
    color: var(--success);
}

.stat.expense i {
    color: var(--danger);
}

.stat strong {
    color: var(--text-primary);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.chart-container {
    height: 350px;
    position: relative;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tx-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    transition: var(--transition);
}

.tx-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tx-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tx-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.2);
    color: var(--primary-color);
}

.tx-details p {
    color: var(--text-primary);
    font-weight: 500;
}

.tx-details span {
    font-size: 0.8rem;
}

.tx-amount {
    font-weight: 600;
}

/* Filter Bar */
.tools-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem !important;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.search-box input {
    background: none;
    border: none;
    color: white;
    outline: none;
    width: 100%;
}

select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--surface-border);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    outline: none;
}

select option {
    background: var(--bg-color);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
}

.close-btn:hover {
    color: white;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--surface-border);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
}

.double-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.type-selector {
    display: flex;
    gap: 0.5rem;
}

.radio-card {
    flex: 1;
    cursor: pointer;
}

.radio-card input {
    display: none;
}

.card-content {
    display: block;
    text-align: center;
    padding: 0.75rem;
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.radio-card input:checked+.card-content {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.w-full {
    width: 100%;
}

.mt-4 {
    margin-top: 1rem;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.transactions-table th,
.transactions-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--surface-border);
}

.transactions-table th {
    color: var(--text-secondary);
    font-weight: 500;
}

.transactions-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-bottom: 5rem;
        padding-top: 100px;
    }

    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: rgba(15, 23, 42, 0.9);
        backdrop-filter: blur(10px);
        padding: 1rem 1.5rem;
        z-index: 100;
        border-bottom: 1px solid var(--surface-border);
    }

    .header-desktop {
        display: none;
    }

    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
        padding: 0.5rem;
        border-top: 1px solid var(--surface-border);
        z-index: 100;
    }

    .nav-item {
        color: var(--text-secondary);
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .nav-item.active {
        color: var(--primary-color);
    }

    .nav-item i {
        font-size: 1.25rem;
    }

    .fab-container {
        position: relative;
        top: -20px;
    }

    .fab-btn {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: var(--primary-color);
        color: white;
        border: none;
        font-size: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 10px rgba(139, 92, 246, 0.4);
    }

    .tools-bar {
        flex-direction: column;
    }

    .card-hero h2 {
        font-size: 2rem;
    }
}

/* Modal / Overlays */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.login-overlay:not(.active) {
    display: none;
}

.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card .logo {
    font-family: 'Outfit';
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-card h2 {
    margin-bottom: 2rem;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    border-radius: 8px;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 250px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    animation: slideInX 0.3s ease forwards;
    opacity: 0;
    transform: translateX(100%);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideInX {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Cards UI Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.credit-card-ui {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.cc-nubank {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
}

.cc-itau {
    background: linear-gradient(135deg, #EA580C, #C2410C);
}

.cc-inter {
    background: linear-gradient(135deg, #F97316, #D97706);
}

.cc-ml {
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.card-chip {
    width: 45px;
    height: 35px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    position: relative;
    background-image: linear-gradient(to right, transparent 40%, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0.1) 60%, transparent 60%);
}

.card-brand {
    font-family: 'Outfit';
    font-weight: bold;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.card-number {
    letter-spacing: 2px;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.card-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.card-label {
    font-size: 0.7rem;
    opacity: 0.7;
    text-transform: uppercase;
    display: block;
}

.card-stats {
    margin-top: 1rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--warning);
    border-radius: 4px;
}

.progress-fill.safe {
    background: var(--success);
    border-radius: 4px;
}

.progress-fill.danger {
    background: var(--danger);
    border-radius: 4px;
}