:root {
    /* Light theme variables */
    --primary: #0066FF;
    --success: #4CAF50;
    --background: #F4F7FE;
    --card: #FFFFFF;
    --text: #1A1F36;
    --text-secondary: #666666;
    --input-bg: #F8FAFF;
    --input-border: #E5E9F2;
    --shadow: rgba(0, 102, 255, 0.08);
    --error: #FF5252;
}

/* Dark theme variables */
[data-theme="dark"] {
    --primary: #0066FF;
    --success: #4CAF50;
    --background: #0A0A0A;
    --card: #1A1A1A;
    --text: #FFFFFF;
    --text-secondary: #A0A0A0;
    --input-bg: #262626;
    --input-border: #333333;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Add smooth transitions for theme switching */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    padding: 15px;
}

.container {
    width: 100%;
    max-width: 620px; /* Increased width */
    padding: 0 20px; /* Added horizontal padding */
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 24px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

.status-dot.offline {
    background: var(--error);
}

.converter {
    background: var(--card);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    overflow: hidden; /* Prevent content overflow */
}

.form-row {
    margin-bottom: 20px;
}

.form-row.currencies {
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    gap: 20px; /* Increased gap */
    align-items: center;
}

.input-group {
    width: 100%;
}

label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

input, select {
    width: 100%;
    box-sizing: border-box;
    height: 50px;
    padding: 0 35px 0 15px;
    min-width: unset; /* Remove min-width to prevent overflow */
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666'%3E%3Cpath d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.swap-button {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--input-bg);
    color: var(--primary);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.swap-button:hover {
    background: var(--primary);
    color: white;
    transform: rotate(180deg);
}

.convert-button {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
}

.convert-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 102, 255, 0.4);
}

#result {
    margin-top: 20px;
    padding: 15px;
    background: var(--input-bg);
    border-radius: 8px;
    text-align: center;
    font-size: 15px;
    opacity: 0;
    transition: opacity 0.3s;
}

#result.show {
    opacity: 1;
}

/* Loading animation */
.loading {
    display: inline-flex;
    gap: 8px;
    justify-content: center;
}

.loading div {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: bounce 0.5s infinite alternate;
}

.loading div:nth-child(2) { animation-delay: 0.15s; }
.loading div:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
    to { transform: translateY(-4px); }
}

@media (max-width: 720px) {
    .container {
        max-width: 100%;
        padding: 15px;
    }

    .converter {
        padding: 25px;
    }

    .form-row.currencies {
        grid-template-columns: 1fr 50px 1fr;
        gap: 15px;
    }

    h1 {
        font-size: 24px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 10px;
    }

    .converter {
        padding: 20px;
    }

    select {
        min-width: unset;
    }
}

.theme-switch {
    position: fixed;
    top: 20px;
    right: 20px;
}

.theme-switch button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow);
}

@media (min-width: 768px) {
    body {
        padding: 20px;
    }

    h1 {
        font-size: 2.5em;
    }

    .converter {
        padding: 30px;
        margin: 0;
    }

    .form-row {
        flex-direction: row;
        align-items: center;
    }

    .form-row.currencies {
        flex-direction: row;
        align-items: center;
    }
}

.select-wrapper select:hover {
    text-overflow: unset;
    white-space: unset;
    overflow: unset;
    position: static;
    z-index: auto;
    width: 100%;
}

/* Footer styles */
.footer {
    margin-top: 30px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.copyright {
    margin-bottom: 10px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

.link-button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    text-decoration: underline;
}

.separator {
    color: var(--text-secondary);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--card);
    margin: 20px auto; /* Reduced top margin */
    padding: 0;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--input-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text);
}

.close-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-button:hover {
    background: var(--input-bg);
}

.modal-body {
    padding: 20px;
    color: var(--text);
    max-height: 70vh;
    overflow-y: auto;
}

.modal-body h3 {
    margin-top: 0;
}

.modal-body h4 {
    margin: 20px 0 10px;
}

.modal-body p {
    margin: 10px 0;
    line-height: 1.5;
    color: var(--text-secondary);
}

.update-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.chart-container {
    margin-top: 25px;
    padding: 20px;
    background: var(--input-bg);
    border-radius: 8px;
    height: 300px; /* Made taller */
    border: 1px solid var(--input-border);
}

/* Chart title styles */
.chart-title {
    color: var(--text);
    font-size: 16px;
    margin-bottom: 15px;
}

/* Update media query for mobile */
@media (max-width: 640px) {
    .chart-container {
        height: 250px;
        padding: 15px;
    }
}

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
}

/* Features page styles */
.features-page .content-card {
    background: var(--card);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
}

.feature-section {
    margin-bottom: 40px;
}

.feature-section h2 {
    color: var(--text);
    font-size: 24px;
    margin-bottom: 20px;
}

.currency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.currency-item {
    background: var(--input-bg);
    padding: 15px;
    border-radius: 8px;
    color: var(--text);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-item {
    background: var(--input-bg);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.feature-item i {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 15px;
}

.feature-item h3 {
    color: var(--text);
    margin: 10px 0;
    font-size: 18px;
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.instructions {
    color: var(--text);
    line-height: 1.8;
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.back-link {
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.back-link:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .features-page .content-card {
        padding: 20px;
    }

    .currency-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.feature-link {
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.feature-link:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .header-actions {
        gap: 15px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
}

.support-text {
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
}

.support-email {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    margin-top: 10px;
}

.support-email:hover {
    text-decoration: underline;
}

.logo {
    height: 32px;  /* Reduced from 40px */
    width: auto;
    object-fit: contain;
    display: block;
}

/* Add specific styles for features page logo */
.features-page .logo {
    height: 28px;  /* Slightly smaller in features page */
    margin-right: 12px; /* Space between logo and "Features & Support" text */
}

.features-page h1 {
    display: flex;
    align-items: center;
    font-size: 22px; /* Adjusted text size */
}

@media (max-width: 640px) {
    .logo {
        height: 26px;  /* Even smaller on mobile */
    }
    
    .features-page .logo {
        height: 24px;
    }
    
    .features-page h1 {
        font-size: 20px;
    }
}

.brand-name {
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-decoration: none;
    cursor: pointer;
}

.currency {
    color: var(--text);
    font-size: 28px;
    background: linear-gradient(135deg, #2193b0, #6dd5ed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.buddy {
    color: var(--primary);
    font-size: 28px;
    background: linear-gradient(135deg, #0066FF, #00A3FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Features page specific styles */
.features-page .brand-name {
    font-size: 24px;
}

.title-separator {
    margin: 0 12px;
    color: var(--text-secondary);
    opacity: 0.5;
}

.page-title {
    color: var(--text-secondary);
    font-weight: normal;
    font-size: 20px;
}

@media (max-width: 640px) {
    .brand-name {
        font-size: 24px;
    }
    
    .currency, .buddy {
        font-size: 24px;
    }

    .features-page .brand-name {
        font-size: 20px;
    }
    
    .page-title {
        font-size: 18px;
    }
} 