/* Currency Converter CSS - Mobile-First Design */
/* File: assets/css/currency-converter.css */

:root {
    --tcc-primary: #2563eb;
    --tcc-primary-hover: #1d4ed8;
    --tcc-success: #059669;
    --tcc-error: #dc2626;
    --tcc-warning: #d97706;
    --tcc-neutral: #6b7280;
    --tcc-light: #f8fafc;
    --tcc-dark: #1e293b;
    --tcc-border: #e2e8f0;
    --tcc-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --tcc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --tcc-radius: 8px;
    --tcc-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Base Container */
.tcc-converter-container {
    font-family: var(--tcc-font-sans);
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: var(--tcc-radius);
    box-shadow: var(--tcc-shadow-lg);
    border: 1px solid var(--tcc-border);
    position: relative;
    box-sizing: border-box;
}

/* Header */
.tcc-converter-header {
    text-align: center;
    margin-bottom: 24px;
}

.tcc-converter-header h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--tcc-dark);
    line-height: 1.2;
}

.tcc-converter-header p {
    margin: 0;
    font-size: 14px;
    color: var(--tcc-neutral);
}

/* Form Elements */
.tcc-converter-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Amount Input */
.tcc-amount-input {
    width: 100%;
}

.tcc-amount-input label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--tcc-dark);
    margin-bottom: 6px;
}

.tcc-amount-input input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--tcc-border);
    border-radius: var(--tcc-radius);
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    box-sizing: border-box;
}

.tcc-amount-input input:focus {
    outline: none;
    border-color: var(--tcc-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Hide number input spinners */
.tcc-amount-input input::-webkit-outer-spin-button,
.tcc-amount-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Currency Row - Fixed Layout */
/* REPLACE THIS ENTIRE SECTION IN YOUR CSS FILE */
/* Currency Row Layout */
.tcc-currency-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 20px;
}

/* Currency Input Container */
.tcc-currency-input {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

.tcc-currency-input label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

/* THE MAIN DROPDOWN STYLING - THIS FIXES THE VISIBILITY */
.tcc-currency-input select {
    /* CRITICAL: These properties ensure dropdown works */
    width: 100%;
    height: 48px;
    padding: 12px 30px 12px 12px;
    
    /* Visual styling */
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background-color: #ffffff;
    
    /* Text styling */
    font-size: 16px;
    font-weight: 700;
    color: #2563eb;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    
    /* CRITICAL: Native dropdown functionality */
    appearance: auto;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    
    /* Behavior */
    cursor: pointer;
    transition: all 0.2s ease;
    
    /* CRITICAL: Ensure it's not hidden */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 999;
}

/* Dropdown hover and focus states */
.tcc-currency-input select:hover {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tcc-currency-input select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* CRITICAL: Option styling for dropdown list */
.tcc-currency-input select option {
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    background-color: #ffffff;
    color: #333333;
    border: none;
    
    /* CRITICAL: Ensure options are visible */
    display: block !important;
    visibility: visible !important;
}

.tcc-currency-input select option:checked,
.tcc-currency-input select option:hover {
    background-color: #2563eb;
    color: #ffffff;
}

/* Switch button styling */
.tcc-switch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#tcc-switch {
    width: 48px;
    height: 48px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    background: #ffffff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tcc-switch:hover {
    background: #f8fafc;
    border-color: #2563eb;
    transform: scale(1.05);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .tcc-currency-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .tcc-currency-input {
        max-width: 100%;
        width: 100%;
    }
    
    .tcc-currency-input select {
        font-size: 16px; /* Prevents zoom on iOS */
        height: 52px;
        padding: 14px 12px;
    }
    
    .tcc-switch-btn {
        order: 3;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .tcc-currency-input select {
        font-size: 15px;
        height: 48px;
        padding: 12px 10px;
    }
    
    #tcc-switch {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
}




/* Fees Section */
.tcc-fees-section {
    border-top: 1px solid var(--tcc-border);
    padding-top: 20px;
    margin-top: 20px;
}

.tcc-fees-toggle label {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--tcc-dark);
    cursor: pointer;
}

.tcc-fees-toggle input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.tcc-fees-inputs {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tcc-fee-input label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--tcc-neutral);
    margin-bottom: 4px;
}

.tcc-fee-input input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--tcc-border);
    border-radius: var(--tcc-radius);
    font-size: 14px;
    box-sizing: border-box;
}

/* Convert Button */
.tcc-convert-btn {
    width: 100%;
    padding: 16px;
    background: var(--tcc-primary);
    color: white;
    border: none;
    border-radius: var(--tcc-radius);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 24px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tcc-convert-btn:hover {
    background: var(--tcc-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--tcc-shadow-lg);
}

.tcc-convert-btn:active {
    transform: translateY(0);
}

.tcc-convert-btn:disabled {
    background: var(--tcc-neutral);
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.tcc-results {
    margin-top: 24px;
    border-top: 2px solid var(--tcc-border);
    padding-top: 24px;
}

.tcc-loading {
    text-align: center;
    padding: 20px;
    color: var(--tcc-neutral);
    font-weight: 600;
}

.tcc-loading span {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Result Content */
.tcc-result-main {
    background: var(--tcc-light);
    border-radius: var(--tcc-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.tcc-conversion-result {
    text-align: center;
    margin-bottom: 16px;
}

.tcc-amount-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tcc-from-amount {
    font-size: 18px;
    color: var(--tcc-neutral);
    font-weight: 600;
}

.tcc-equals {
    font-size: 16px;
    color: var(--tcc-neutral);
    font-weight: 700;
}

.tcc-to-amount {
    font-size: 28px;
    color: var(--tcc-success);
    font-weight: 800;
}

.tcc-same-currency {
    font-size: 24px;
    color: var(--tcc-primary);
    font-weight: 700;
}

.tcc-same-currency-note {
    font-size: 14px;
    color: var(--tcc-neutral);
    margin-top: 8px;
}

/* Rate Info */
.tcc-rate-info {
    text-align: center;
    border-top: 1px solid var(--tcc-border);
    padding-top: 16px;
}

.tcc-rate {
    font-size: 16px;
    font-weight: 600;
    color: var(--tcc-dark);
    margin-bottom: 4px;
}

.tcc-timestamp {
    font-size: 12px;
    color: var(--tcc-neutral);
}

/* Fees Result */
.tcc-fees-result {
    background: white;
    border-radius: var(--tcc-radius);
    padding: 16px;
    margin-top: 16px;
    border: 1px solid var(--tcc-border);
}

.tcc-fee-breakdown {
    font-size: 14px;
}

.tcc-fee-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--tcc-dark);
}

.tcc-fee-savings {
    font-weight: 700;
    color: var(--tcc-warning);
    border-top: 1px solid var(--tcc-border);
    padding-top: 8px;
    margin-top: 8px;
}

/* Error Display */
.tcc-error {
    background: #fef2f2;
    color: var(--tcc-error);
    padding: 16px;
    border-radius: var(--tcc-radius);
    text-align: center;
    font-weight: 600;
}

/* Share Section */
.tcc-share-section {
    text-align: center;
    margin-top: 20px;
}

.tcc-share-btn {
    background: var(--tcc-neutral);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--tcc-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tcc-share-btn:hover {
    background: var(--tcc-dark);
    transform: translateY(-1px);
}

/* Monetization Sections */
.tcc-ad-container {
    margin: 20px 0;
    text-align: center;
    min-height: 100px;
    background: var(--tcc-light);
    border-radius: var(--tcc-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--tcc-border);
}

.tcc-affiliate-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: var(--tcc-radius);
    margin: 20px 0;
}

.tcc-affiliate-section h4 {
    margin: 0 0 16px 0;
    text-align: center;
    font-size: 18px;
}

.tcc-affiliate-grid {
    display: grid;
    gap: 12px;
}

.tcc-affiliate-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--tcc-radius);
    padding: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
}

.tcc-affiliate-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.tcc-affiliate-card a {
    color: white;
    text-decoration: none;
    display: block;
    font-size: 14px;
    line-height: 1.4;
}

.tcc-affiliate-card strong {
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

/* Tablet Styles */
@media (min-width: 768px) {
    .tcc-converter-container {
        max-width: 600px;
        padding: 32px;
    }
    
    .tcc-converter-header h3 {
        font-size: 32px;
    }
    
    .tcc-amount-display {
        flex-direction: row;
        justify-content: center;
        gap: 16px;
    }
    
    .tcc-affiliate-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .tcc-fees-inputs {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .tcc-converter-container {
        max-width: 700px;
        padding: 40px;
    }
    
    .tcc-affiliate-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Dark Theme */
.tcc-converter-container[data-theme="dark"] {
    background: var(--tcc-dark);
    color: white;
    border-color: #374151;
}

.tcc-converter-container[data-theme="dark"] .tcc-converter-header h3,
.tcc-converter-container[data-theme="dark"] .tcc-currency-input label,
.tcc-converter-container[data-theme="dark"] .tcc-amount-input label {
    color: white;
}

.tcc-converter-container[data-theme="dark"] input,
.tcc-converter-container[data-theme="dark"] select {
    background: #374151;
    border-color: #4b5563;
    color: white;
}

.tcc-converter-container[data-theme="dark"] .tcc-result-main {
    background: #374151;
}

/* Minimal Theme */
.tcc-converter-container[data-theme="minimal"] {
    box-shadow: none;
    border: none;
    background: transparent;
}

.tcc-converter-container[data-theme="minimal"] .tcc-converter-header h3 {
    font-size: 20px;
    margin-bottom: 16px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .tcc-converter-container {
        margin: 0 10px;
        padding: 16px;
    }
    
    .tcc-amount-input input,
    .tcc-currency-input select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .tcc-currency-row {
        gap: 8px;
    }
    
    .tcc-currency-input select {
        padding: 14px 35px 14px 12px;
        font-size: 16px;
        font-weight: 700;
        letter-spacing: 0.5px;
    }
    
    #tcc-switch {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .tcc-currency-row {
        gap: 6px;
    }
    
    .tcc-currency-input select {
        padding: 12px 30px 12px 8px;
        font-size: 15px;
    }
    
    #tcc-switch {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.tcc-converter-container *:focus {
    outline: 2px solid var(--tcc-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tcc-converter-container {
        border: 3px solid;
    }
    
    .tcc-convert-btn {
        border: 2px solid white;
    }
}

/* Loading states */
.tcc-converting {
    opacity: 0.7;
    pointer-events: none;
}

.tcc-converting .tcc-convert-btn {
    background: var(--tcc-neutral);
}

.tcc-converting .tcc-convert-btn::after {
    content: " 🔄";
    animation: spin 1s linear infinite;
}

/* Responsive text sizing */
@media (max-width: 480px) {
    .tcc-converter-header h3 {
        font-size: 20px;
    }
    
    .tcc-to-amount {
        font-size: 24px;
    }
    
    .tcc-convert-btn {
        font-size: 16px;
        padding: 14px;
    }
}