@import url('https://fonts.cdnfonts.com/css/codec-pro');

:root {
    --primary-color: #1084FE;
    --primary-dark: #0D6FD9;
    --secondary-color: #F8F9FA;
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --background: #FFFFFF;
    --surface: #F9FAFB;
    
    --font-primary: 'Sora', sans-serif;
    --font-secondary: 'DM Sans', sans-serif;
    --font-logo: 'Codec Pro', 'Sora', sans-serif;
    
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-secondary);
    color: var(--text-primary);
    background: var(--background);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 300;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Navigation */
.navbar {
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-lg) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.logo-text {
    font-family: var(--font-logo);
    display: flex;
}

.logo-bold {
    font-weight: 600;
}

.logo-regular {
    font-weight: 400;
}

.logo img {
    width: 32px;
    height: 32px;
}

.back-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary-color);
}

/* Calculator Section */
.calculator-section {
    padding: var(--spacing-xl) 0 var(--spacing-lg) 0;
    background: var(--surface);
    min-height: calc(100vh - 80px);
}

.calculator-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.calculator-header h1 {
    font-family: var(--font-primary);
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.calculator-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Currency Selector */
.currency-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.currency-selector label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.currency-selector select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: var(--font-secondary);
    font-weight: 500;
    color: var(--text-primary);
    background: var(--background);
    cursor: pointer;
    transition: var(--transition);
}

.currency-selector select:hover {
    border-color: var(--primary-color);
}

.currency-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 132, 254, 0.1);
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

/* Input Sections */
.calculator-inputs {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.input-section {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    position: relative;
}

.section-header i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.section-header h3 {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

/* Currency Toggle Button */
.currency-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 132, 254, 0.3);
    margin-left: auto;
}

.currency-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 132, 254, 0.4);
}

.currency-toggle:active {
    transform: scale(0.95);
}

/* Currency Dropdown */
.currency-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-width: 120px;
}

.currency-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.currency-option {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.currency-option:hover {
    background: var(--surface);
    color: var(--primary-color);
}

.currency-option.active {
    background: var(--primary-color);
    color: white;
}

.input-group {
    margin-bottom: var(--spacing-md);
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
}

.input-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: var(--font-secondary);
    transition: var(--transition);
    background: var(--background);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 132, 254, 0.1);
}

.input-with-prefix,
.input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-prefix input {
    padding-left: 2.5rem;
}

.input-with-suffix input {
    padding-right: 3rem;
}

.prefix,
.suffix {
    position: absolute;
    color: var(--text-secondary);
    font-weight: 600;
    pointer-events: none;
}

.prefix {
    left: 1rem;
}

.suffix {
    right: 1rem;
}

.input-help {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.info-box {
    background: rgba(16, 132, 254, 0.05);
    border: 1px solid rgba(16, 132, 254, 0.2);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    display: flex;
    gap: var(--spacing-sm);
    align-items: start;
    margin-top: var(--spacing-sm);
}

.info-box i {
    color: var(--primary-color);
    font-size: 1rem;
    flex-shrink: 0;
}

.info-box p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Results */
.calculator-results {
    position: relative;
}

.results-sticky {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.result-card {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-md);
}

.result-card.primary {
    background: var(--primary-color);
    color: white;
}

.result-card.primary .result-header h3,
.result-card.primary .rate-label,
.result-card.primary .rate-value {
    color: white;
}

.result-card.primary .divider {
    background: rgba(255, 255, 255, 0.2);
}

.result-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-color);
}

.result-card.primary .result-header {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.result-header i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.result-card.primary .result-header i {
    color: white;
}

.result-header h3 {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
}

.rate-item.highlight {
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: 0.35rem;
}

.rate-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.result-card.primary .rate-label {
    color: rgba(255, 255, 255, 0.9);
}

.rate-label small {
    font-size: 0.7rem;
    opacity: 0.8;
}

.rate-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-primary);
}

.rate-item.highlight .rate-value {
    font-size: 1.875rem;
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--spacing-sm) 0;
}

/* Breakdown */
.result-card.breakdown {
    background: var(--surface);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.85rem;
}

.breakdown-item.small {
    font-size: 0.75rem;
    padding: 0.25rem 0 0.25rem var(--spacing-md);
}

.breakdown-label {
    color: var(--text-secondary);
}

.breakdown-value {
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-primary);
}

/* Tips Card */
.tips-card {
    background: rgba(16, 132, 254, 0.05);
    border: 1px solid rgba(16, 132, 254, 0.2);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.tips-card i {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.tips-card h4 {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.tips-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tips-card li {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding-left: 1.25rem;
    position: relative;
    line-height: 1.4;
}

.tips-card li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

/* CTA Section */
.cta-section {
    background: var(--primary-color);
    padding: 5rem 0;
    text-align: center;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.cta-content h2 {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: var(--spacing-lg);
    line-height: 1.2;
}

.cta-content p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--spacing-2xl);
    font-weight: 300;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(16, 132, 254, 0.1);
    transition: left 0.4s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary i {
    transition: transform 0.3s ease;
}

.btn-primary:hover i {
    transform: translateX(4px);
}

.btn-large {
    padding: 1.25rem 2.5rem;
    font-size: 1.25rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: var(--spacing-2xl) 0 var(--spacing-lg) 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.footer-brand .logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: white;
    font-size: 1.25rem;
}

.footer-brand .logo img {
    width: 32px;
    height: 32px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 300;
    max-width: 300px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
}

.footer-column h4 {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: white;
}

.footer-column ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.footer-column a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 300;
    transition: var(--transition);
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-md);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 300;
}

/* Responsive */
@media (max-width: 1024px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .results-sticky {
        position: static;
    }
    
    .input-row {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .calculator-header h1 {
        font-size: 1.5rem;
    }
    
    .calculator-header p {
        font-size: 0.875rem;
    }
    
    .rate-value {
        font-size: 1.25rem;
    }
    
    .rate-item.highlight .rate-value {
        font-size: 1.5rem;
    }
    
    .calculator-section {
        padding: var(--spacing-lg) 0 var(--spacing-md) 0;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
    }
    
    .cta-section {
        padding: 3rem 0;
        margin: 3rem 0;
    }
    
    .cta-content h2 {
        font-size: 2rem;
    }
    
    .cta-content p {
        font-size: 1.125rem;
    }
    
    .btn-large {
        padding: 1rem 2rem;
        font-size: 1.125rem;
    }
}
