/* styles.css */
:root {
    --primary-color: #6c5ce7;
    --secondary-color: #8078e3;
    --background-light: #f8f9fc;
    --background-dark: #121220;
    --text-light: #2d3436;
    --text-dark: #f1f1f1;
    --card-light: rgba(255, 255, 255, 0.9);
    --card-dark: rgba(22, 24, 35, 0.7);
    --shadow-light: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --shadow-dark: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --border-light: 1px solid rgba(200, 200, 200, 0.3);
    --border-dark: 1px solid rgba(255, 255, 255, 0.08);
    --error-color: #e74c3c;
    --success-color: #2ecc71;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--background-light);
    color: var(--text-light);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
}

body.dark-mode {
    background: var(--background-dark);
    color: var(--text-dark);
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, #6c5ce7, #a8a4e6);
    opacity: 0.05;
    animation: gradient 15s ease infinite;
    background-size: 200% 200%;
}

.dark-mode .background-animation {
    background: linear-gradient(45deg, #2c2c54, #474787);
    opacity: 0.1;
}

.glass-nav {
    background: var(--card-light);
    backdrop-filter: blur(10px);
    border-bottom: var(--border-light);
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto; /* Changed to grid for better alignment */
    align-items: center;
    gap: 2rem; /* Added gap between elements */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.dark-mode .glass-nav {
    background: var(--card-dark);
    border-bottom: var(--border-dark);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-logo i {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    justify-content: center; /* Center the links */
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: inherit;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500; /* Added font weight */
    position: relative; /* For hover effect */
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 80%;
}

.nav-links a.active,
.nav-links a:hover {
    background: var(--primary-color);
    color: white;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto; /* Push to the right */
}

#theme-toggle {
    background: rgba(108, 92, 231, 0.1);
    border-radius: 50%;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode #theme-toggle {
    background: rgba(255, 255, 255, 0.1);
}

#theme-toggle:hover {
    background: rgba(71, 65, 115, 0.2);
}

.dark-mode #theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.user-profile {
    border: none;
    background: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;

}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-profile span {
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
}

.dark-mode .user-profile span {
    color: var(--text-dark);
}


main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

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

.glass-card {
    background: var(--card-light);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    border: var(--border-light);
    transition: transform 0.3s, box-shadow 0.3s;
}

.dark-mode .glass-card {
    background: var(--card-dark);
    box-shadow: var(--shadow-dark);
    border: var(--border-dark);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-light);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.card-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.card-amount {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.card-trend.positive {
    color: #00b894;
}

.card-trend.negative {
    color: #d63031;
}

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

.chart-card {
    min-height: 300px;
}

.recent-transactions .glass-card {
    padding: 0;
}

.recent-transactions .card-header {
    padding: 1.5rem;
    border-bottom: var(--border-light);
    margin-bottom: 0;
}

.dark-mode .recent-transactions .card-header {
    border-bottom: var(--border-dark);
}

.view-all {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.view-all:hover {
    background: var(--secondary-color);
}

.transactions-list {
    padding: 1.5rem;
}

.add-transaction-btn {
    margin-left: auto;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.transaction-form-container {
    padding: 1.5rem;
    border-bottom: var(--border-light);
}

.transaction-form {
    display: grid;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.transaction-form input,
.transaction-form select,
.transaction-form textarea {
    padding: 0.8rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--card-light);
    color: var(--text-light);
}

.form-actions {
    display: flex;
    gap: 1rem;
}

.form-actions button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.form-actions button[type="submit"] {
    background: var(--primary-color);
    color: white;
}

.cancel-btn {
    background: #dfe6e9;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: var(--border-light);
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.transaction-category {
    font-weight: 600;
}

.transaction-date,
.transaction-description {
    font-size: 0.9rem;
    color: #666;
}

.transaction-amount {
    font-weight: 600;
}

.transaction-amount.income {
    color: var(--success-color);
    font-weight: 600;
}

.transaction-amount.expense {
    color: var(--error-color);
    font-weight: 600;
}

.dark-mode .transaction-date,
.dark-mode .transaction-description {
    color: #b2bec3;
}

.transaction-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.delete-transaction {
    background: none;
    border: none;
    color: #d63031;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-transaction:hover {
    background: rgba(214, 48, 49, 0.1);
}

.goal-card {
    margin-bottom: 1rem;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.goal-progress {
    margin: 1rem 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.goal-amounts {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-light);
}

.delete-goal {
    background: none;
    border: none;
    color: #d63031;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.delete-goal:hover {
    background: rgba(214, 48, 49, 0.1);
}

.goals-list {
    margin-bottom: 2rem;
}

#ai-advice {
    padding: 1.5rem;
    margin-top: 2rem;
}

#getAdviceBtn {
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

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

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

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

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Style the transaction form container like a glass card */
.transaction-form-container {
    background: var(--card-light);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    border: var(--border-light);
    max-width: 600px;
    margin: 2rem auto;
}

/* Dark mode styling for the transaction form container */
.dark-mode .transaction-form-container {
    background: var(--card-dark);
    border: var(--border-dark);
    box-shadow: var(--shadow-dark);
}

/* Style form inputs and selects to match the theme */
.transaction-form input,
.transaction-form select,
.transaction-form textarea {
    padding: 0.8rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--card-light);
    color: var(--text-light);
    transition: border-color 0.3s, background 0.3s;
}

/* Dark mode adjustments for form inputs */
.dark-mode .transaction-form input,
.dark-mode .transaction-form select,
.dark-mode .transaction-form textarea {
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
    color: var(--text-dark);
}

/* Enhance form action buttons */
.form-actions button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.form-actions button[type="submit"] {
    background: var(--primary-color);
    color: white;
}



/* Optional: Add a subtle hover effect */
.form-actions button:hover {
    opacity: 0.9;
}

/* Style the select dropdown to match the input fields */
.transaction-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: var(--card-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.8rem;
    color: var(--text-light);
    transition: border-color 0.3s, background 0.3s;
    /* Custom arrow icon */
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%236c5ce7' d='M2 0L0 2h4L2 0z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.65rem;
    padding-right: 2rem; /* Ensure space for the arrow */
}

/* Dark mode adjustments for select dropdown */
.dark-mode .transaction-form select {
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
    color: var(--text-dark);
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23f1f1f1' d='M2 0L0 2h4L2 0z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.65rem;
    padding-right: 2rem; /* Ensure space for the arrow */
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--card-light);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border: var(--border-light);
    width: 90%;
    max-width: 400px;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
    opacity: 2;
}

.dark-mode .modal-container { 
    background: rgba(16, 18, 27, 0.8); /* Increased opacity */
    box-shadow: var(--shadow-dark);
    border: var(--border-dark);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dark-mode .modal-title {
    color: var(--text-dark);
}

.close-modal {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.1);
}

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

.form-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
}

.form-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--card-light);
    color: var(--text-light);
    transition: all 0.3s ease;
}

.dark-mode .form-input {
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
    color: var(--text-dark);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.forgot-password {
    text-align: right;
    margin-bottom: 1.5rem;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.forgot-password a:hover {
    color: var(--secondary-color);
}

.submit-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.social-login {
    margin-top: 1.5rem;
    text-align: center;
}

.social-login p {
    color: var(--text-light);
    margin-bottom: 1rem;
    position: relative;
}

.dark-mode .social-login p {
    color: var(--text-dark);
}

.social-login p::before,
.social-login p::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: var(--border-light);
}

.errorTxt {
    color: #d63031;
}

.social-login p::before {
    left: 0;
}

.social-login p::after {
    right: 0;
}

.social-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-btn {
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: rgba(108, 92, 231, 0.1);
    transform: translateY(-2px);
}

.social-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

@keyframes modalIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .modal-container {
        width: 95%;
        padding: 1.5rem;
    }
}
/* Auth Container Styles */
.sign-in-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.sign-in-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.user-profile {
    position: relative;
    cursor: pointer;
    color: var(--text-light);
    font-weight: 600;
    font-size: 13px;
}

.dark-mode .user-profile{
    color: var(--text-dark);
    font-weight: 600;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--card-light);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    border: var(--border-light);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dark-mode .user-dropdown {
    background: var(--card-dark);
    box-shadow: var(--shadow-dark);
    border: var(--border-dark);
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    transition: background-color 0.3s;
}

.dark-mode .dropdown-item {
    color: var(--text-dark);
}

.dropdown-item:hover {
    background: rgba(108, 92, 231, 0.1);
}

.dropdown-item i {
    color: var(--primary-color);
}

.user-dropdown hr {
    margin: 0.5rem 0;
    border: none;
    border-top: var(--border-light);
}

.dark-mode .user-dropdown hr {
    border-top: var(--border-dark);
}

