/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f0f4f8, #d9e2ec);
    color: #333;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Dark mode */
body.dark-mode {
    background: linear-gradient(135deg, #1c2526, #2e3b3e);
    color: #e0e0e0;
}

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

/* Header styles */
.header {
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: #fff;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
    border: 1px solid #2980b9;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo img {
    height: 50px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo img:hover {
    transform: scale(1.1);
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 20px;
    padding: 5px 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-bar input {
    border: none;
    outline: none;
    padding: 5px;
    font-size: 14px;
    color: #333;
}

.search-bar button {
    background: none;
    border: none;
    cursor: pointer;
    color: #3498db;
    font-size: 16px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav ul li a:hover {
    color: #f1c40f;
}

.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-toggle input {
    display: none;
}

.theme-toggle label {
    cursor: pointer;
    font-size: 20px;
    color: #fff;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle input:checked + label .fa-moon {
    display: none;
}

.theme-toggle input:not(:checked) + label .fa-sun {
    display: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.menu-toggle .fa-times {
    display: none;
}

.menu-toggle.active .fa-bars {
    display: none;
}

.menu-toggle.active .fa-times {
    display: inline;
}

/* Main content */
.main-content {
    display: flex;
    gap: 20px;
    margin: 30px auto;
    flex-wrap: wrap;
}

.sidebar {
    flex: 1;
    min-width: 200px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #dfe6e9;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    align-self: flex-start;
    height: auto;
}

.sidebar:hover {
    transform: translateY(-5px);
}

.sidebar h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    color: #34495e;
    text-decoration: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: #3498db;
    color: #fff;
}

/* Footer styles */
.footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    padding: 40px 0;
    margin-top: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid #34495e;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer:hover {
    transform: translateY(-5px);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #ecf0f1;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-column ul li a:hover {
    color: #3498db;
}

.footer-column.subscribe form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 100%;
}

.footer-column.subscribe input[type="email"] {
    padding: 10px;
    border: 1px solid #34495e;
    border-radius: 5px;
    font-size: 14px;
    background: #34495e;
    color: #fff;
    outline: none;
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-sizing: border-box;
}

.footer-column.subscribe input[type="email"]::placeholder {
    color: #bdc3c7;
}

.footer-column.subscribe input[type="email"]:focus {
    border-color: #3498db;
}

.footer-column.subscribe button {
    padding: 10px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-sizing: border-box;
}

.footer-column.subscribe button:hover {
    background: #2980b9;
}

.footer-bottom {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #34495e;
}

.footer-bottom p {
    font-size: 14px;
    color: #bdc3c7;
}

/* Dark mode adjustments */
body.dark-mode .sidebar,
body.dark-mode .footer {
    background: #2e3b3e;
    border-color: #34495e;
}

body.dark-mode .sidebar h2 {
    color: #ecf0f1;
}

body.dark-mode .sidebar ul li a {
    color: #bdc3c7;
}

body.dark-mode .sidebar ul li a:hover,
body.dark-mode .sidebar ul li a.active {
    background: #4fc3f7;
    color: #fff;
}

body.dark-mode .footer {
    background: linear-gradient(135deg, #1c2526, #2c3e50);
    border-color: #2c3e50;
}

body.dark-mode .footer-column h3 {
    color: #ecf0f1;
}

body.dark-mode .footer-column ul li a {
    color: #bdc3c7;
}

body.dark-mode .footer-column ul li a:hover {
    color: #4fc3f7;
}

body.dark-mode .footer-column.subscribe input[type="email"] {
    background: #2c3e50;
    border-color: #2c3e50;
    color: #fff;
}

body.dark-mode .footer-column.subscribe input[type="email"]:focus {
    border-color: #4fc3f7;
}

body.dark-mode .footer-column.subscribe button {
    background: #4fc3f7;
}

body.dark-mode .footer-column.subscribe button:hover {
    background: #0288d1;
}

body.dark-mode .footer-bottom p {
    color: #bdc3c7;
}

/* Content section styles */
.content {
    flex: 3;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #dfe6e9;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.content:hover {
    transform: translateY(-5px);
}

.content h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.content p {
    font-size: 16px;
    margin-bottom: 20px;
    color: #34495e;
}

body.dark-mode .content {
    background: #2e3b3e;
    border-color: #34495e;
}

body.dark-mode .content h2 {
    color: #ecf0f1;
}

body.dark-mode .content p {
    color: #bdc3c7;
}

/* Glassmorphism effect */
.glassmorphic {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glassmorphic:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

body.dark-mode .glassmorphic {
    background: rgba(46, 59, 62, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Calculator form */
.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    margin-bottom: 20px;
}

.form-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.form-group label {
    font-size: 16px;
    color: #2c3e50;
    min-width: 150px;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid #dfe6e9;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input {
    flex: 1;
}

.form-group select {
    max-width: 100px;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
    transform: translateY(-3px) scale(1.02);
}

.form-group .tooltip {
    cursor: pointer;
    font-size: 12px;
    color: #3498db;
    margin-left: 5px;
}

body.dark-mode .form-group label {
    color: #ecf0f1;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select {
    background: #34495e;
    border-color: #34495e;
    color: #fff;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus {
    border-color: #4fc3f7;
    box-shadow: 0 0 8px rgba(79, 195, 247, 0.3);
}

body.dark-mode .form-group .tooltip {
    color: #4fc3f7;
}

/* Neon button */
.neon-button {
    padding: 10px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5), 0 0 20px rgba(52, 152, 219, 0.3);
}

.neon-button:hover {
    background: #2980b9;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.7), 0 0 30px rgba(52, 152, 219, 0.5);
    transform: scale(1.05) translateY(-3px);
}

body.dark-mode .neon-button {
    background: #4fc3f7;
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.5), 0 0 20px rgba(79, 195, 247, 0.3);
}

body.dark-mode .neon-button:hover {
    background: #0288d1;
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.7), 0 0 30px rgba(79, 195, 247, 0.5);
}

/* Calculator results */
.calculator-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.result-card {
    padding: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-card.show {
    opacity: 1;
    transform: translateY(0);
}

.result-card:hover {
    transform: rotate(2deg) translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.result-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.result-card p {
    font-size: 14px;
    color: #34495e;
    margin-bottom: 8px;
}

.tooltip {
    cursor: pointer;
    font-size: 12px;
    color: #3498db;
    margin-left: 5px;
}

body.dark-mode .result-card h3,
body.dark-mode .result-card p {
    color: #ecf0f1;
}

body.dark-mode .tooltip {
    color: #4fc3f7;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    background: #dfe6e9;
    border-radius: 5px;
    height: 10px;
    margin-top: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: #3498db;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode .progress-bar {
    background: #34495e;
}

body.dark-mode .progress {
    background: #4fc3f7;
}

/* Payment schedule table */
.payment-schedule {
    margin-top: 20px;
    width: 100%;
}

.table-container {
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
}

#scheduleTable {
    width: 100%;
    border-collapse: collapse;
}

#scheduleTable th,
#scheduleTable td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    color: #34495e;
}

#scheduleTable th {
    background: rgba(255, 255, 255, 0.3);
    position: sticky;
    top: 0;
    color: #2c3e50;
}

body.dark-mode #scheduleTable th,
body.dark-mode #scheduleTable td {
    color: #ecf0f1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode #scheduleTable th {
    background: rgba(46, 59, 62, 0.3);
}

.schedule-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Chart styles */
canvas {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 10px;
    width: 100%;
}

body.dark-mode canvas {
    background: rgba(46, 59, 62, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Recent calculations */
.recent-calculations {
    margin-top: 20px;
    width: 100%;
}

.recent-calculations h3 {
    font-size: 20px;
    margin: 20px 0 10px;
    color: #2c3e50;
}

.recent-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    width: 100%;
}

.recent-card {
    padding: 10px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.recent-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.recent-card p {
    font-size: 13px;
    color: #34495e;
    margin: 0;
}

body.dark-mode .recent-calculations h3 {
    color: #ecf0f1;
}

body.dark-mode .recent-card p {
    color: #bdc3c7;
}

/* About calculator */
.about-calculator {
    margin-top: 20px;
    padding: 20px;
    width: 100%;
}

.about-calculator h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.about-calculator h4 {
    font-size: 18px;
    margin: 15px 0 10px;
    color: #2c3e50;
}

.about-calculator p {
    font-size: 14px;
    color: #34495e;
    margin-bottom: 10px;
}

.about-calculator ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 10px;
}

.about-calculator ul li {
    font-size: 14px;
    color: #34495e;
    margin-bottom: 8px;
}

body.dark-mode .about-calculator h3,
body.dark-mode .about-calculator h4,
body.dark-mode .about-calculator p,
body.dark-mode .about-calculator ul li {
    color: #ecf0f1;
}

/* Particle canvas */
.particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.2;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .nav-container {
        display: none;
        width: 100%;
    }

    .nav-container.active {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
    }

    nav ul li {
        width: 100%;
    }

    nav ul li a {
        display: block;
        padding: 10px;
        border-radius: 5px;
    }

    .theme-toggle {
        align-self: flex-end;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 20px;
    }

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

    .sidebar,
    .content {
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-column.subscribe form {
        max-width: 100%;
    }

    .calculator-results {
        grid-template-columns: 1fr;
    }

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

    .form-group {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }

    .form-group label {
        min-width: 120px;
    }

    .form-group select {
        max-width: 80px;
    }
}

@media (max-width: 600px) {
    .content h2 {
        font-size: 24px;
    }

    .calculator-form label,
    .result-card p,
    .about-calculator p,
    .about-calculator ul li,
    #scheduleTable th,
    #scheduleTable td {
        font-size: 14px;
    }

    .calculator-form input,
    .calculator-form select,
    .neon-button {
        font-size: 13px;
    }

    .result-card h3,
    .recent-calculations h3,
    .payment-schedule h3,
    .about-calculator h3 {
        font-size: 18px;
    }

    .about-calculator h4 {
        font-size: 16px;
    }

    .recent-card p {
        font-size: 12px;
    }

    .sidebar h2 {
        font-size: 18px;
    }

    .sidebar ul li a {
        font-size: 14px;
    }

    .footer {
        padding: 20px 0;
    }

    .footer-column h3 {
        font-size: 16px;
    }

    .footer-column ul li a {
        font-size: 13px;
    }

    .footer-column.subscribe input[type="email"],
    .footer-column.subscribe button {
        font-size: 13px;
        width: 100%;
        box-sizing: border-box;
    }

    .footer-bottom p {
        font-size: 13px;
    }

    .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-group label {
        min-width: unset;
    }

    .form-group select {
        max-width: 100%;
    }
}

/* Keyframe animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}