/* Base Styles and Variables */
:root {
    --primary-color: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-dark: #5641e5;
    --secondary-color: #00b894;
    --secondary-light: #55efc4;
    --secondary-dark: #00a885;
    --accent-color: #fd79a8;
    --dark-color: #2d3436;
    --light-color: #f8f9fa;
    --light-gray: #dfe6e9;
    --mid-gray: #b2bec3;
    --success-color: #00b894;
    --danger-color: #d63031;
    --warning-color: #fdcb6e;
    --border-radius: 8px;
    --box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    text-align: center;
    position: relative;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--mid-gray);
    text-align: center;
    margin-bottom: 3rem;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.2);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 184, 148, 0.2);
}

.highlight {
    color: var(--primary-color);
}

.hidden {
    display: none !important; /* Ensure this overrides other display properties */
}

/* Language Switcher Styles */
#language-switcher {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-left: auto; /* Push switcher to the right on desktop */
}

#language-switcher button {
    background: none;
    border: 1px solid var(--light-gray);
    padding: 5px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: normal;
    transition: var(--transition);
    color: var(--dark-color);
    line-height: 1; /* Ensure consistent button height */
}

#language-switcher button:hover {
    background-color: var(--light-gray);
}

#language-switcher button[style*="bold"] { /* Style for active language */
    font-weight: bold !important;
    text-decoration: none !important; /* Remove underline for active */
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #e9e7ff; /* Lighter background for active */
}


/* Header & Navigation */
header {
    background-color: white;
    height: var(--header-height);
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

nav {
    display: flex;
    align-items: center;
    gap: 1rem; /* Default gap for desktop */
}

.nav-links {
    display: flex; /* Display links inline on desktop */
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.hamburger {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001; /* Ensure hamburger is clickable */
}

.hamburger span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: var(--dark-color);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(var(--primary-light), transparent 70%);
    opacity: 0.3;
    top: -150px;
    left: -150px;
}

.hero::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(var(--secondary-light), transparent 70%);
    opacity: 0.3;
    bottom: -150px;
    right: -150px;
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--mid-gray);
    margin-bottom: 2rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.hero-image img {
    max-width: 90%;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Loan Options Section */
.loan-options {
    padding: 100px 0;
    background-color: white;
}

.loan-cards {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 2rem;
}

.loan-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    transition: var(--transition);
    width: 320px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--light-gray);
}

.loan-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.loan-card.featured {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
}

.loan-card.featured:hover {
    transform: scale(1.05) translateY(-10px);
}

.featured-tag {
    position: absolute;
    top: 15px;
    right: -30px;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 30px;
    transform: rotate(45deg);
    font-size: 0.8rem;
    font-weight: 600;
}

.loan-amount {
    text-align: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--light-gray);
}

.loan-amount h3 {
    font-size: 2.2rem;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.loan-amount p {
    color: var(--mid-gray);
    font-size: 0.9rem;
}

.loan-details ul {
    margin-bottom: 25px;
}

.loan-details li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.loan-details li i {
    color: var(--success-color);
    margin-right: 10px;
}

.loan-card .btn {
    width: 100%;
}

/* Market Data Section */
.market-data {
    padding: 100px 0;
    background-color: var(--light-color);
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 10px 25px;
    background-color: white;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-content {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.market-charts {
    display: none;
}

.market-charts.active {
    display: block;
}

.market-rows {
    display: flex;
    flex-direction: column;
}

.market-row {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--light-gray);
}

.market-row:last-child {
    border-bottom: none;
}

.market-info {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 35%;
}

.coin-icon {
    width: 40px;
    height: 40px;
    display: flex; /* Keep flex for potential future background/placeholder */
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    /* background-color: var(--light-gray); Removed as images have backgrounds */
}

.stock-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Ensure circular shape */
    object-fit: contain; /* Fit logo within the circle */
}

.market-info h4 {
    margin-bottom: 2px;
}

.market-info span {
    font-size: 0.8rem;
    color: var(--mid-gray);
}

.price-change {
    display: flex;
    flex-direction: column;
    width: 25%;
}

.price {
    font-weight: 600;
    font-size: 1.1rem;
}

.change {
    font-size: 0.9rem;
}

.up .change {
    color: var(--success-color);
}

.down .change {
    color: var(--danger-color);
}

.chart-container {
    flex-grow: 1;
    height: 60px;
}

/* Loan Application Section */
.loan-application {
    padding: 100px 0;
    background-color: white;
}

.application-container {
    max-width: 700px;
    margin: 0 auto;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 40px;
}

.loan-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

label {
    font-weight: 500;
    color: var(--dark-color);
}

input, select {
    padding: 12px 15px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    font-weight: 400;
}

.submit-btn {
    margin-top: 10px;
    font-size: 1.1rem;
    padding: 15px;
}

/* About Us Section */
.about-us {
    padding: 100px 0;
    background-color: var(--light-color);
}

.about-content {
    display: flex;
    gap: 50px;
    align-items: center;
    margin-top: 40px;
}

.about-image {
    flex: 1;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 20px;
}

.about-text h3 {
    margin: 25px 0 15px;
    font-size: 1.5rem;
}

.about-text ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.about-text li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-text li i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 70px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 50px;
}

.footer-logo h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.footer-logo p {
    color: var(--mid-gray);
}

.footer-links {
    display: flex;
    gap: 60px;
}

.footer-column h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: white;
}

.footer-column ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-column a {
    color: var(--mid-gray);
}

.footer-column a:hover {
    color: white;
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--mid-gray);
}

.contact-info i {
    color: var(--primary-light);
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--mid-gray);
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary-color);
}

.success-icon {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 20px;
}

.modal h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.modal p {
    margin-bottom: 30px;
    color: var(--mid-gray);
}

.modal-btn {
    width: 100%;
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 2.8rem;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .loan-cards {
        gap: 20px;
    }

    .loan-card {
        width: 280px;
    }

    .footer-content {
        flex-direction: column;
        gap: 50px;
    }

    .footer-links {
        width: 100%;
        justify-content: space-between;
    }
}

/* --- Responsive Header Adjustments --- */

@media (max-width: 992px) { /* Medium screens */
    .nav-links {
        gap: 1.5rem; /* Slightly reduce nav link gap */
    }
    #language-switcher {
        margin-left: 1rem; /* Add some space */
    }
    nav {
        gap: 0.5rem; /* Reduce gap between nav items */
    }
}


@media (max-width: 768px) { /* Tablets and Phones */
    header .container {
        /* Ensure container uses full width for flex alignment */
    }

    nav {
       /* Remove justify-content, use margin-left on nav itself */
       margin-left: auto; /* Push nav container (switcher + hamburger) to the right */
       gap: 1rem; /* Space between switcher and hamburger */
    }

    .logo {
       flex-shrink: 0; /* Prevent logo from shrinking */
       margin-right: 10px; /* Add some space between logo and nav items */
    }

    /* Hide desktop nav links, prepare mobile slide-out */
    .nav-links {
        position: fixed;
        top: var(--header-height);
        left: -100%; /* Start off-screen */
        width: 70%; /* Adjust width as needed */
        max-width: 300px;
        height: calc(100vh - var(--header-height));
        background-color: white;
        flex-direction: column; /* Stack links vertically */
        align-items: center;
        justify-content: flex-start;
        padding: 40px 20px;
        gap: 2rem; /* Increase gap for vertical layout */
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 1000; /* Ensure nav is above content but below header */
        margin-right: 0; /* Reset desktop margin */
    }

     /* Ensure language switcher is NOT in the mobile slide-out nav */
    .nav-links #language-switcher {
        display: none;
    }

    .nav-links.active {
        left: 0; /* Slide in */
    }

    /* Show hamburger */
    .hamburger {
        display: flex; /* Show hamburger */
        order: 3; /* Place hamburger last */
        z-index: 1001; /* Ensure hamburger is clickable */
    }

    /* Keep language switcher visible in the header, place before hamburger */
    #language-switcher {
        display: flex; /* Ensure it's visible */
        order: 1; /* Switcher first in the nav group */
        margin-left: 0; /* Reset desktop margin */
    }

    /* Adjust hamburger order */
     .hamburger {
        display: flex; /* Show hamburger */
        order: 2; /* Hamburger second in the nav group */
        z-index: 1001; /* Ensure hamburger is clickable */
    }

     .hamburger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Other mobile adjustments */
    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-image {
        justify-content: center;
        margin-top: 40px;
    }

    .loan-card {
        width: 100%;
        max-width: 320px;
    }

    .market-row {
        flex-wrap: wrap;
    }

    .market-info {
        width: 50%;
    }

    .price-change {
        width: 50%;
        text-align: right;
    }

    .chart-container {
        width: 100%;
        margin-top: 15px;
    }

    .about-content {
        flex-direction: column;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 30px;
    }

    .footer-column {
        width: 45%;
    }

    .form-row {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .market-info, .price-change {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .price-change {
        margin: 15px 0;
    }

    .footer-column {
        width: 100%;
    }

    .application-container {
        padding: 25px;
    }

    #language-switcher {
        gap: 3px; /* Reduce gap further on small screens */
        margin-right: 10px; /* Adjust space before hamburger */
    }
    #language-switcher button {
        padding: 4px 6px; /* Smaller buttons */
        font-size: 0.75rem;
    }
    nav {
        gap: 0.5rem; /* Reduce gap further */
    }
}
