/* ===== Global Styles ===== */
:root {
    --primary-color: #6c63ff;
    --secondary-color: #4db6ac;
    --accent-color: #ff7043;
    --background-color: #f8f9fa;
    --text-color: #333;
    --light-text: #777;
    --border-color: #e0e0e0;
    --success-color: #66bb6a;
    --error-color: #ef5350;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background-color);
    position: relative;
    min-height: 100vh;
}

/* Creating a colorful background with a model-style design */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: var(--gradient-bg);
    opacity: 0.05;
    z-index: -1;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(108, 99, 255, 0.1) 0%, transparent 200px),
        radial-gradient(circle at 70% 60%, rgba(77, 182, 172, 0.1) 0%, transparent 200px),
        radial-gradient(circle at 90% 10%, rgba(255, 112, 67, 0.1) 0%, transparent 200px);
    z-index: -1;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

h1, h2, h3, h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

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

/* ===== Header Styles ===== */
header {
    background-color: #fff;
    box-shadow: var(--box-shadow);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-svg {
    color: var(--primary-color);
    margin-right: 10px;
}

.logo h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
    color: var(--primary-color);
}

nav ul {
    display: flex;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

nav ul li a:hover {
    border-bottom: 2px solid var(--primary-color);
}

/* ===== Main Content ===== */
main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Ad spaces */
.ad-space {
    background-color: #fff;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    font-weight: bold;
    color: var(--light-text);
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--box-shadow);
}

/* Expense Tracker Section */
.expense-tracker {
    background-color: #fff;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--box-shadow);
}

.expense-tracker h2 {
    color: var(--primary-color);
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

/* Form Styles */
.form-container {
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.2);
}

.btn-add {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

.btn-add:hover {
    background-color: #5a52d5;
}

/* Expenses List Styles */
.expenses-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.expenses-container h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.expense-summary {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background-color: #fff;
    border-radius: 6px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.expense-summary p {
    font-weight: 600;
}

#expense-total {
    color: var(--primary-color);
    font-weight: 700;
}

.expense-list-container {
    max-height: 400px;
    overflow-y: auto;
}

#expense-list {
    list-style: none;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #fff;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.expense-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.expense-info {
    flex: 1;
}

.expense-name {
    font-weight: 600;
    color: var(--text-color);
}

.expense-date {
    color: var(--light-text);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.expense-amount {
    font-weight: 700;
    color: var(--accent-color);
    margin: 0 1.5rem;
}

.btn-delete {
    background-color: transparent;
    color: var(--error-color);
    border: 1px solid var(--error-color);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
}

.btn-delete:hover {
    background-color: rgba(239, 83, 80, 0.1);
}

/* SEO Article Section */
.seo-article {
    background-color: #fff;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--box-shadow);
}

.seo-article h2 {
    color: var(--primary-color);
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.seo-article article {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-color);
}

.seo-article h3 {
    color: var(--secondary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.seo-article p {
    margin-bottom: 1rem;
}

.seo-article ul, .seo-article ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.seo-article li {
    margin-bottom: 0.5rem;
}

/* Footer Styles */
footer {
    background-color: #333;
    color: #fff;
    padding: 3rem 2rem 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section {
    flex: 1;
    min-width: 250px;
    margin-bottom: 2rem;
    padding-right: 2rem;
}

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    color: #ccc;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #444;
    max-width: 1200px;
    margin: 0 auto;
}

.copyright p {
    color: #aaa;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem;
    }

    .logo {
        margin-bottom: 1rem;
    }

    nav ul {
        width: 100%;
        justify-content: center;
    }

    nav ul li {
        margin: 0 1rem;
    }

    .expense-tracker {
        padding: 1.5rem;
    }

    .form-container, .expenses-container {
        padding: 1rem;
    }

    .footer-content {
        flex-direction: column;
    }

    .footer-section {
        padding-right: 0;
    }
}

@media (max-width: 480px) {
    main {
        padding: 1rem;
    }

    .expense-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .expense-amount {
        margin: 0.5rem 0;
    }

    .btn-delete {
        align-self: flex-end;
        margin-top: -2rem;
    }
}

/* Animation for adding new expenses */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}
