/* static/css/style.css */
:root {
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --income-color: #22c55e;
    --expense-color: #ef4444;
}

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

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
}

/* Background Blobs */
.body-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: #6366f1;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: #ec4899;
    animation-delay: -5s;
}

.blob-3 {
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    background: #14b8a6;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(30px, -30px);
    }

    50% {
        transform: translate(-20px, 20px);
    }

    75% {
        transform: translate(20px, 30px);
    }
}

/* Navigation */
.glass-nav {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-main);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--text-main);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--glass-shadow);
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card-income,
.card-expense,
.card-balance {
    text-align: center;
    padding: 30px;
}

.card-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.card-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
}

.card-balance.positive .card-value {
    color: var(--income-color);
}

.card-balance.negative .card-value {
    color: var(--expense-color);
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.category-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

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

.category-values {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.category-remaining {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Tables */
.transactions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.transactions-table th,
.transactions-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.transactions-table th {
    color: var(--text-muted);
    font-weight: normal;
    font-size: 0.9rem;
}

.text-income {
    color: var(--income-color);
}

.text-expense {
    color: var(--expense-color);
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.glass-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s;
}

.glass-input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(0, 0, 0, 0.3);
}

.color-input {
    width: 60px;
    height: 45px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-delete {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 8px 12px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* FAB Button */
.fab-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5);
    transition: all 0.3s;
}

.fab-button:hover {
    transform: scale(1.1);
}

/* Flash Messages */
.flash-message {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.flash-success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.flash-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Auth Panel */
.auth-panel {
    max-width: 400px;
    margin: 60px auto;
    text-align: center;
}

.auth-panel h1 {
    margin-bottom: 30px;
}

.auth-link {
    margin-top: 20px;
    color: var(--text-muted);
}

.auth-link a {
    color: #6366f1;
    text-decoration: none;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-muted);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
}

.divider:not(:empty)::before {
    margin-right: .5em;
}

.divider:not(:empty)::after {
    margin-left: .5em;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: white;
    color: #1f1f1f;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-google:hover {
    background: #f1f1f1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* Footer */
.glass-footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 60px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

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

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

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

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

/* Installments List */
.installments-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.installment-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.installment-month {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.installment-amount {
    display: block;
    font-size: 1.2rem;
    color: var(--expense-color);
}

.installment-count {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Inline Form */
.inline-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.inline-form .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.category-color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-info {
    flex: 1;
}

.edit-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.edit-form .glass-input {
    width: auto;
    min-width: 120px;
}

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

.month-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.month-selector a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.2rem;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.month-selector span {
    font-weight: bold;
    min-width: 100px;
    text-align: center;
}

.form-panel {
    max-width: 600px;
    margin: 0 auto;
}

.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-muted);
    text-transform: capitalize;
}