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

body {
    /* ✅ Better font stack dengan fallbacks */
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    /* ✅ Better font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);  /* ✅ Slightly more opaque */
    padding: 20px;
    border-radius: 12px;  /* ✅ Slightly more rounded */
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);  /* ✅ Better shadow */
    backdrop-filter: blur(10px);  /* ✅ Glass effect */
}

header h1 {
    color: #667eea;
    font-weight: 700;  /* ✅ Bolder for brand */
    font-size: 1.8rem;
    letter-spacing: -0.02em;  /* ✅ Tighter letter spacing */
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 15px;  /* ✅ More spacing */
}

.user-info {
    font-weight: 500;  /* ✅ Medium weight */
    color: #667eea;
    font-size: 0.95rem;
}

.btn {
    padding: 12px 24px;  /* ✅ More padding */
    border: none;
    border-radius: 8px;  /* ✅ More rounded */
    cursor: pointer;
    font-weight: 500;  /* ✅ Medium weight */
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);  /* ✅ Better easing */
    text-transform: none;
    letter-spacing: 0.025em;
}

.btn-primary {
    background-color: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);  /* ✅ Button shadow */
}

.btn-primary:hover {
    background-color: #5a6fd8;
    transform: translateY(-2px);  /* ✅ Hover lift effect */
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.summary {
    background: rgba(255, 255, 255, 0.95);
    padding: 32px;  /* ✅ More padding */
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.balance {
    text-align: center;
    margin-bottom: 24px;  /* ✅ More spacing */
}

.balance h2 {
    color: #667eea;
    font-weight: 600;  /* ✅ Semibold */
    font-size: 1.25rem;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

#totalBalance {
    font-size: 3rem;  /* ✅ Larger for impact */
    font-weight: 700;  /* ✅ Bold */
    color: #333;
    letter-spacing: -0.03em;  /* ✅ Tighter for large text */
    margin-top: 8px;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.income, .expense {
    text-align: center;
    padding: 24px;  /* ✅ More padding */
    border-radius: 12px;  /* ✅ Consistent radius */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);  /* ✅ Subtle shadow */
}

.income {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);  /* ✅ Gradient */
    color: #155724;
}

.expense {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);  /* ✅ Gradient */
    color: #721c24;
}

.income h3, .expense h3 {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.income div, .expense div {
    font-weight: 700;  /* ✅ Bold numbers */
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.add-transaction {
    background: rgba(255, 255, 255, 0.95);
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.add-transaction h3 {
    color: #667eea;
    font-weight: 600;  /* ✅ Semibold */
    font-size: 1.25rem;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

#transactionForm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;  /* ✅ Consistent spacing */
    align-items: end;
}

#transactionForm input,
#transactionForm select {
    padding: 14px 16px;  /* ✅ More padding */
    border: 2px solid #e9ecef;  /* ✅ Lighter border */
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;  /* ✅ Inherit Quicksand */
    font-weight: 400;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

#transactionForm input:focus,
#transactionForm select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);  /* ✅ Focus ring */
}

#transactionForm button {
    grid-column: span 2;
    margin-top: 8px;
}

.transactions {
    background: rgba(255, 255, 255, 0.95);
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.transactions h3 {
    color: #667eea;
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;  /* ✅ More padding */
    border: 1px solid #e9ecef;
    border-radius: 12px;  /* ✅ Consistent radius */
    margin-bottom: 12px;
    background: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.transaction-item:hover {
    transform: translateY(-1px);  /* ✅ Hover effect */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.transaction-info {
    flex: 1;
}

.transaction-info > div:first-child {
    font-weight: 500;  /* ✅ Medium weight for description */
    font-size: 1rem;
    color: #333;
    margin-bottom: 4px;
}

.transaction-info > div:last-child {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 400;
}

.transaction-amount {
    font-weight: 600;  /* ✅ Semibold for amounts */
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    margin-right: 12px;
}

.transaction-amount.income {
    color: #28a745;
}

.transaction-amount.expense {
    color: #dc3545;
}

.transaction-category {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 4px 12px;
    border-radius: 20px;  /* ✅ More rounded */
    font-size: 0.75rem;
    font-weight: 500;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 8px;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background-color: #c82333;
    transform: scale(1.05);
}

.modal {
    display: flex;  /* ✅ Use flex for centering */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);  /* ✅ Darker overlay */
    z-index: 1000;
    backdrop-filter: blur(4px);  /* ✅ Blur background */
}

.modal-content {
    margin: auto;  /* ✅ Center with flexbox */
    background: white;
    padding: 40px;  /* ✅ More padding */
    border-radius: 16px;  /* ✅ More rounded */
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);  /* ✅ Dramatic shadow */
}

.modal-content h2 {
    color: #667eea;
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: -0.01em;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-content input {
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 400;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.modal-content input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-content p {
    text-align: center;
    margin-top: 20px;
    font-weight: 400;
    color: #6c757d;
}

.modal-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.modal-content a:hover {
    text-decoration: underline;
}

/* HERO styles (new) */
.hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 0;
    padding: 60px 40px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.hero-content h1 {
    font-size: 3rem;
    color: white;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-tagline {
    color: rgba(255,255,255,0.95);
    margin-bottom: 24px;
    font-size: 1.15rem;
    line-height: 1.6;
    font-weight: 400;
}

.hero-features {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.hero-features li {
    background: rgba(255,255,255,0.12);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.hero-features li:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-2px);
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.05rem;
    font-weight: 600;
}

.hero-footer {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    font-weight: 400;
    margin: 0;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* small mockup card */
.mockup {
    width: 100%;
    max-width: 400px;
    background: linear-gradient(180deg, #ffffff, #f7f9ff);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(18, 25, 50, 0.2);
    color: #222;
}

.mockup-header {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.mockup-balance {
    font-weight: 700;
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: #333;
    letter-spacing: -0.02em;
}

.mockup-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.mockup-col {
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.mockup-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    opacity: 0.8;
}

.mockup-col div:last-child {
    font-weight: 700;
    font-size: 1.2rem;
}

.mockup-col.income {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.mockup-col.expense {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

/* make hero responsive */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 40px 24px;
        gap: 32px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-features {
        grid-template-columns: 1fr;
    }

    .mockup {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 32px 20px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-tagline {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn-large {
        width: 100%;
        text-align: center;
    }
}

/* ✅ Responsive improvements */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    #totalBalance {
        font-size: 2.5rem;  /* ✅ Smaller on mobile */
    }
    
    .stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    #transactionForm {
        grid-template-columns: 1fr;
    }
    
    #transactionForm button {
        grid-column: span 1;
    }
    
    header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .auth-section {
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-content {
        padding: 32px 24px;
        width: 95%;
    }
}

/* ✅ Animation keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.transaction-item {
    animation: fadeIn 0.3s ease-out;
}