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

html {
    font-size: 16px;
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* Landing Page Styles */
.landing-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.landing-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><filter id="glow"><feGaussianBlur stdDeviation="3" result="coloredBlur"/><feMerge><feMergeNode in="coloredBlur"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><circle cx="100" cy="200" r="2" fill="rgba(255,255,255,0.3)" filter="url(%23glow)"/><circle cx="800" cy="300" r="1" fill="rgba(255,255,255,0.2)" filter="url(%23glow)"/><circle cx="300" cy="800" r="1.5" fill="rgba(255,255,255,0.4)" filter="url(%23glow)"/></svg>');
    animation: float 20s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(-20px) rotate(360deg);
    }
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: #ffeb3b;
    transform: translateY(-2px);
}

.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    position: relative;
}

.hero-content {
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-button {
    display: inline-block;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

.hero-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 107, 107, 0.4);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 4rem 5%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.feature-card {
    background: rgba(255, 255, 255, 0.2);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.feature-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1rem;
}

.feature-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

/* Application Styles */
.app-container {
    display: none;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.app-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.app-nav {
    display: flex;
    gap: 2rem;
}

.nav-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-button:hover,
.nav-button.active {
    background: rgba(255, 255, 255, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    color: white;
    font-size: 0.9rem;
}

.logout-btn {
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    transform: translateY(-2px);
}

.app-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    position: relative;
}

.summary-title {
    font-size: 1.2rem;
    color: white;
    margin-bottom: 1rem;
}

.summary-amount {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffeb3b;
}

.summary-amount.spent {
    color: #ff6b6b;
}

.edit-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.expense-form {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    color: white;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-select option {
    background: #333;
    color: white;
}

.form-button {
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
}

.form-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

.cancel-btn {
    background: #95a5a6;
    margin-top: 1rem;
}

.cancel-btn:hover {
    background: #7f8c8d;
    box-shadow: 0 8px 20px rgba(149, 165, 166, 0.3);
}

.expense-list {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.expense-filters {
    margin-bottom: 1.5rem;
}

.expense-filters .form-select {
    width: 200px;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.expense-item:last-child {
    border-bottom: none;
}

.expense-details {
    flex: 1;
}

.expense-title {
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.expense-date {
    font-size: 0.8rem;
    opacity: 0.8;
}

.expense-category {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    color: white;
    margin-right: 1rem;
}

.expense-amount {
    font-weight: bold;
    color: #ff6b6b;
    margin-right: 1rem;
}

.expense-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-expense-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.edit-expense-btn:hover {
    background: #2980b9;
}

.delete-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #d32f2f;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal h3 {
    font-size: 2rem;
    color: white;
    margin-bottom: 2rem;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-buttons .form-button {
    flex: 1;
}

.update-btn {
    background: linear-gradient(45deg, #4caf50, #8bc34a);
}

.update-btn:hover {
    background: linear-gradient(45deg, #3d8b40, #7cb342);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
}

/* Auth Pages Styles */
.login-container {
    display: none;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    align-items: center;
    justify-content: center;
}

.login-form {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-title {
    font-size: 2rem;
    color: white;
    margin-bottom: 2rem;
}

.auth-switch {
    color: white;
    margin-top: 1rem;
}

.auth-link {
    background: none;
    border: none;
    color: #ffeb3b;
    cursor: pointer;
    text-decoration: underline;
    font-size: inherit;
}

.auth-link:hover {
    color: #ffd93d;
}

.back-to-landing {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 1rem;
}

.back-to-landing:hover {
    color: #ffeb3b;
}

/* Spinner */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4caf50;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Error and Success Messages */
.error-message {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: left;
}

.success-message {
    color: #4caf50;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* Responsive Fixes */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
    }

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

    .nav-links {
        display: none;
    }

    .landing-nav,
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .expense-form {
        padding: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-button {
        font-size: 0.95rem;
        padding: 0.8rem 1.5rem;
    }

    .expense-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem 0;
    }

    .expense-amount {
        margin-right: 0;
    }

    .expense-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .edit-expense-btn,
    .delete-btn {
        width: 100%;
        text-align: center;
        padding: 0.6rem 1rem;
        border-radius: 12px;
    }

    .expense-filters {
        flex-direction: column;
        gap: 1rem;
    }

    .expense-filters .form-select {
        width: 100%;
    }

    .modal-content {
        padding: 2rem;
        margin: 1rem;
    }
}

/* [Previous CSS remains the same until .app-content] */

/* Analytics View Styles */
.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.analytics-header h2 {
    font-size: 1.8rem;
    color: white;
}

.time-period-selector select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.analytics-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.analytics-card h3 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

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

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

#topExpensesList {
    max-height: 300px;
    overflow-y: auto;
}

.top-expense-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.top-expense-item:last-child {
    border-bottom: none;
}

.category-dist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.category-dist-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-dist-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin: 0 1rem;
    overflow: hidden;
}

.category-dist-progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px;
}

.category-dist-amount {
    font-weight: bold;
    color: #ffeb3b;
}

/* Responsive fixes for analytics */
@media (max-width: 768px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .analytics-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .chart-container {
        height: 250px;
    }
}