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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    padding: 0;
    margin: 0;
}

/* Navigation Styles */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 70px;
}

.nav-brand {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand:hover {
    color: #e9ecef;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #f8f9fa;
}

.nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.nav-toggle:hover {
    background: rgba(255,255,255,0.1);
}

/* Mobile Menu Styles */
.nav-menu.mobile {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    gap: 10px;
}

.nav-menu.mobile.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Main Layout with Sidebar */
.main-content-wrapper {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    gap: 30px;
}

.main-content {
    flex: 1;
    min-width: 300px;
}

.sidebar {
    /* This is the key change: sets a fixed base width */
    flex: 0 0 340px; 
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);

    /* --- Add these lines for the sticky effect --- */
    position: sticky;
    top: 90px; /* 70px for the navbar + 20px top margin */
    align-self: flex-start; /* Ensures correct alignment in the flex container */
    max-height: calc(100vh - 110px); /* Prevents the sidebar from being too tall for the screen */
    overflow-y: auto; /* Adds a scrollbar if the sidebar content is too long */
}

.container {
    max-width: 900px;
    margin: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.currency-title {
    font-size: 24px;
    color: #495057;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.share-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 20px;
}

.exchange-rate {
    font-size: 48px;
    font-weight: 300;
    color: #212529;
    margin: 8px 0;
}

.rate-info {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 20px;
}

.converter-inputs {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: center;
}

.input-group {
    flex: 1;
    min-width: 0;
}

.input-wrapper {
    display: flex;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: border-color 0.2s;
    min-width: 0;
}

.input-wrapper:focus-within {
    border-color: #007bff;
}

.amount-input {
    flex: 1;
    padding: 16px;
    border: none;
    font-size: 18px;
    outline: none;
    background: transparent;
    min-width: 80px;
}

.currency-select {
    padding: 16px 20px;
    border: none;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 16px;
    color: #495057;
    min-width: 180px;
    max-width: 220px;
    outline: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.currency-select:hover {
    background: #e9ecef;
}

.chart-section {
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

.time-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.time-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.time-btn:hover {
    background: #f8f9fa;
}

.time-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-top: 20px;
}

.rate-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.rate-change.positive {
    color: #28a745;
}

.rate-change.negative {
    color: #dc3545;
}

.swap-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    font-size: 18px;
    color: #6c757d;
}

.swap-btn:hover {
    background: #e9ecef;
    transform: rotate(180deg);
}

/* Sidebar Styles */
.sidebar-widget {
    margin-bottom: 35px;
}

.sidebar-widget h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #343a40;
}

.sidebar-widget h4 {
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #495057;
}

.sidebar-widget p {
    font-size: 15px;
    line-height: 1.7;
    color: #6c757d;
    margin-bottom: 15px;
}

.sidebar-widget ul {
    list-style: none;
    padding: 0;
}

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

.sidebar-widget ul li a {
    text-decoration: none;
    color: #007bff;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

.sidebar-widget ul li a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* FAQ Section */
.faq-section {
    margin-top: 40px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.faq-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #343a40;
}

.faq {
    border-bottom: 1px solid #e9ecef;
}

.faq:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 20px 0;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #495057;
}

.faq-question::after {
    content: '+';
    font-size: 24px;
    color: #007bff;
    transition: transform 0.3s;
}

.faq.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.faq-answer p {
    padding: 0 0 20px;
    font-size: 16px;
    line-height: 1.6;
    color: #6c757d;
}

.faq.active .faq-answer {
    max-height: 200px;
}

/* Footer Styles */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 40px 20px 20px;
    margin-top: 40px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 10px;
}

.footer-link {
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.footer-link:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.footer-link.creator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.footer-link.creator:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.footer-separator {
    color: #dee2e6;
    margin: 0 8px;
    font-weight: 300;
}

.footer-copyright {
    color: #868e96;
    font-size: 13px;
    margin-top: 15px;
    opacity: 0.8;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    .main-content-wrapper {
        flex-direction: column;
    }
    .sidebar {
        flex: 1 1 100%; /* Allow sidebar to take full width on smaller screens */
    }
    .nav-menu {
        gap: 20px;
    }
    .nav-link {
        padding: 8px 12px;
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    .nav-toggle {
        display: block;
    }
    .nav-menu.mobile {
        display: flex;
    }
    .main-content-wrapper {
        padding: 10px;
        margin: 10px auto;
    }
    .container {
        margin: 0;
    }
    .header {
        padding: 16px;
    }
    .converter-inputs {
        flex-direction: column;
        gap: 12px;
    }
    .input-group {
        width: 100%;
    }
    .input-wrapper {
        width: 100%;
        min-width: 0;
    }
    .swap-btn {
        align-self: center;
        margin: 8px 0;
    }
    .currency-select {
        min-width: 0;
        width: 100%;
        font-size: 15px;
        padding: 16px;
    }
    .amount-input {
        font-size: 16px;
        padding: 14px;
        width: 100%;
        min-width: 0;
    }
    .time-filters {
        flex-wrap: wrap;
        gap: 6px;
    }
    .time-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    .exchange-rate {
        font-size: 36px;
    }
    .currency-title {
        font-size: 20px;
    }
    .nav-link {
        padding: 12px 18px;
    }
    .footer {
        padding: 30px 15px 15px;
        margin-top: 30px;
    }
    .footer-links {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 15px;
    }
    .footer-separator {
        display: none;
    }
    .footer-link {
        padding: 10px 16px;
        min-width: 120px;
        text-align: center;
    }
    .footer-copyright {
        font-size: 12px;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .converter-inputs {
        gap: 8px;
    }
    .input-wrapper {
        flex-direction: column;
        border: none;
        background: transparent;
    }
    .amount-input {
        border: 2px solid #e9ecef;
        border-radius: 8px 8px 0 0;
        padding: 12px;
        font-size: 15px;
        margin: 0;
    }
    .currency-select {
        min-width: auto;
        max-width: none;
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
        border: 2px solid #e9ecef;
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: #f8f9fa;
    }
    .input-wrapper:focus-within .amount-input {
        border-color: #007bff;
        border-bottom: 2px solid #007bff;
    }
    .input-wrapper:focus-within .currency-select {
        border-color: #007bff;
        border-top: none;
    }
    .exchange-rate {
        font-size: 28px;
    }
    .header {
        padding: 12px;
    }
    .footer {
        padding: 25px 10px 10px;
    }
    .footer-content {
        font-size: 13px;
    }
    .footer-link {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 100px;
    }
}
