/* Global Styles & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #C62E2E;
    --secondary-color: #1e1e1e;
    --accent-color: #C1E172;
    --background: #f8f9fa;
    --text-dark: #1e1e1e;
    --text-muted: #6c757d;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--background);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    opacity: 0.8;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav a:hover {
    color: var(--primary-color);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a82525 100%);
    color: var(--white);
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.125rem;
    opacity: 0.95;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    padding: 3rem 0;
}

/* Tool Card */
.tool-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    margin-bottom: 3rem;
}

/* Converter Grid */
.converter-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 2rem;
}

.currency-section {
    display: flex;
    flex-direction: column;
}

.input-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    display: block;
}

.currency-input-group {
    display: flex;
    gap: 0.75rem;
}

.amount-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: var(--transition);
    background: var(--white);
}

.amount-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(198, 46, 46, 0.1);
}

.amount-input:read-only {
    background: #f5f5f5;
    cursor: not-allowed;
}

.currency-select {
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    max-width: 140px;
    max-height: 400px;
}

.currency-select optgroup {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--primary-color);
    background: #f8f9fa;
    padding: 0.5rem 0;
}

.currency-select option {
    padding: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.currency-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(198, 46, 46, 0.1);
}

/* Swap Button */
.swap-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2rem;
}

.swap-btn {
    background: var(--accent-color);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.25rem;
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
}

.swap-btn:hover {
    transform: rotate(180deg);
    background: #b5d165;
}

.swap-btn:active {
    transform: rotate(180deg) scale(0.95);
}

/* Fee Section */
.fee-section {
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.fee-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.fee-toggle {
    position: relative;
    width: 48px;
    height: 24px;
    appearance: none;
    background: #ccc;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.fee-toggle:checked {
    background: var(--primary-color);
}

.fee-toggle::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--white);
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.fee-toggle:checked::before {
    left: 26px;
}

.toggle-text {
    font-weight: 600;
    font-size: 1rem;
}

.fee-info-icon {
    color: var(--text-muted);
    cursor: help;
}

.fee-options {
    margin-top: 1rem;
}

.fee-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.fee-preset-btn {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-dark);
}

.fee-preset-btn:hover {
    border-color: var(--primary-color);
    background: rgba(198, 46, 46, 0.05);
}

.fee-preset-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.custom-fee-input {
    margin-top: 1rem;
}

.input-with-icon {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(198, 46, 46, 0.1);
}

.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: var(--text-muted);
}

/* Rate Info */
.rate-info {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
}

.rate-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rate-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.rate-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Results Card */
.results-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 2px solid var(--border-color);
}

.result-item {
    padding: 1.25rem;
    background: var(--white);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.result-item:last-of-type {
    margin-bottom: 0;
}

.result-item.highlight {
    background: linear-gradient(135deg, var(--accent-color) 0%, #b5d165 100%);
    border: 2px solid #a5c155;
}

.result-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

.result-value.large {
    font-size: 2.25rem;
}

.result-sublabel {
    font-size: 0.875rem;
    color: var(--text-dark);
    opacity: 0.8;
    margin-top: 0.25rem;
}

.result-comparison {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(198, 46, 46, 0.1);
    border-radius: var(--radius-sm);
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 1rem;
}

.btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #a82525;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Loading & Error States */
.loading-state,
.error-state {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-state {
    color: var(--primary-color);
}

.error-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Features Section */
.features-section,
.how-to-section,
.cta-section,
.faq-section,
.content-section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a82525 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.feature-description {
    color: var(--text-muted);
    line-height: 1.6;
}

/* How to Use Section */
.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.step-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--accent-color);
    color: var(--text-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.step-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.step-description {
    color: var(--text-muted);
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a82525 100%);
    color: var(--white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.cta-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
}

.cta-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-description {
    font-size: 1.125rem;
    opacity: 0.95;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.cta-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

.cta-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}

.cta-feature i {
    color: var(--accent-color);
    font-size: 1.25rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-cta-primary {
    background: var(--white);
    color: var(--primary-color);
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-cta-secondary {
    background: transparent;
    color: var(--white);
    padding: 1rem 2rem;
    border: 2px solid var(--white);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-cta-secondary:hover {
    background: var(--white);
    color: var(--primary-color);
}

/* FAQ Section */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--white);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: left;
    transition: var(--transition);
}

.faq-question:hover {
    background: #f8f9fa;
}

.faq-question i {
    transition: var(--transition);
    color: var(--primary-color);
}

.faq-question[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer p {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Content Section */
.content-section {
    max-width: 900px;
    margin: 0 auto 4rem;
}

.content-body {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.content-body h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--text-dark);
}

.content-body p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Footer */
.footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.footer-tagline {
    opacity: 0.8;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-column h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-column a {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0.8;
}

.footer-love {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-love i {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 968px) {
    .converter-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .swap-container {
        padding-top: 0;
    }
    
    .swap-btn {
        transform: rotate(90deg);
    }
    
    .swap-btn:hover {
        transform: rotate(270deg);
    }
    
    .features-grid,
    .steps-container {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-cta-primary,
    .btn-cta-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .currency-input-group {
        flex-direction: column;
    }
    
    .currency-select {
        width: 100%;
    }
    
    .fee-presets {
        grid-template-columns: 1fr;
    }
    
    .rate-info {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Accessibility */
.btn:focus,
.amount-input:focus,
.currency-select:focus,
.form-input:focus,
.faq-question:focus {
    outline: 3px solid rgba(198, 46, 46, 0.3);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .header,
    .nav,
    .hero-badge,
    .button-group,
    .cta-section,
    .footer {
        display: none;
    }
    
    .tool-card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}