/**
 * Currency.css - Currency Converter Styles
 * Basic Calculator Online
 */

/* ======================= CONVERTER SECTION ======================= */
.converter-section {
    padding: 2rem 0 4rem;
    min-height: 60vh;
}

/* Converter Card */
.converter-card {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.converter-card:hover {
    box-shadow: var(--shadow-2xl);
    transform: translateY(-4px);
}

.converter-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.converter-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.converter-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.converter-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

.rate-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.rate-status.live {
    color: #86efac;
}

.rate-status.live i {
    animation: pulse 2s infinite;
}

.rate-status.loading {
    color: #fde68a;
}

.rate-status.loading i {
    animation: spin 1s linear infinite;
}

.rate-status.error {
    color: #fca5a5;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.converter-body {
    padding: 2rem;
}

/* Amount Input */
.converter-input-group {
    margin-bottom: 1.5rem;
}

.converter-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 1.25rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

.amount-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    background: var(--bg-body);
    transition: all var(--transition-fast);
}

.amount-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Currency Selection */
.currency-selection {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
}

.currency-box {
    flex: 1;
}

.currency-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-body);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.currency-display:hover {
    border-color: var(--primary-light);
    background: white;
}

.currency-flag {
    font-size: 2rem;
    line-height: 1;
}

.currency-info {
    flex: 1;
    min-width: 0;
}

.currency-code {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.currency-name {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.currency-display > i {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Swap Button */
.swap-btn {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: white;
    color: var(--primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.swap-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: rotate(180deg);
}

/* Result Display */
.result-display {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.result-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #166534;
    font-variant-numeric: tabular-nums;
}

.result-currency {
    font-size: 1.5rem;
    font-weight: 600;
    color: #22c55e;
}

.exchange-rate {
    font-size: 0.9375rem;
    color: #15803d;
    font-weight: 500;
}

/* Quick Amounts */
.quick-amounts {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-amount-btn {
    flex: 1;
    min-width: 70px;
    padding: 0.625rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: white;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-amount-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.quick-amount-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Converter Footer */
.converter-footer {
    background: var(--bg-body);
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.refresh-rates-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: white;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.refresh-rates-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.refresh-rates-btn:active {
    transform: scale(0.95);
}

.refresh-rates-btn.loading i {
    animation: spin 1s linear infinite;
}

/* Rate Info Card */
.rate-info-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-top: 1.5rem;
    overflow: hidden;
}

.rate-info-header {
    padding: 1rem 1.5rem;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}

.rate-info-header h5 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rate-info-body {
    padding: 1rem 1.5rem;
}

.rate-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-color);
}

.rate-detail:last-child {
    border-bottom: none;
}

.rate-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.rate-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Sidebar Cards */
.sidebar-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h5 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.clear-history-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.clear-history-btn:hover {
    background: #fef2f2;
    color: var(--danger);
}

.sidebar-body {
    padding: 1rem 1.25rem;
    max-height: 300px;
    overflow-y: auto;
}

/* Popular Currency List */
.popular-currency-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.popular-currency-item:hover {
    background: var(--bg-body);
}

.popular-currency-item .currency-flag {
    font-size: 1.5rem;
}

.popular-currency-item .currency-info {
    flex: 1;
}

.popular-currency-item .currency-code {
    font-size: 0.9375rem;
}

.popular-currency-item .currency-rate {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Conversion History */
.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-item:hover {
    background: var(--bg-body);
}

.history-currencies {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.history-currencies i {
    font-size: 0.75rem;
}

.history-amount {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-history {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.empty-history i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.empty-history p {
    margin: 0;
    font-size: 0.875rem;
}

/* ======================= FEATURES SECTION ======================= */
.features-section {
    padding: 4rem 0 5rem;
    background: var(--bg-body);
}

.section-header {
    margin-bottom: 3rem;
}

.section-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-desc {
    font-size: 1.0625rem;
    color: var(--text-muted);
    margin: 0;
}

.feature-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    height: 100%;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.feature-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.feature-desc {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.bg-purple-soft {
    background: rgba(139, 92, 246, 0.1);
}

.text-purple {
    color: #8b5cf6;
}

/* ======================= CURRENCY MODAL ======================= */
.modal-content {
    border: none;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 700;
    font-size: 1.125rem;
}

.modal-body {
    padding: 0;
}

.currency-search {
    position: sticky;
    top: 0;
    background: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.currency-search i {
    color: var(--text-muted);
    font-size: 1.125rem;
}

.currency-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--text-primary);
    background: transparent;
}

.currency-search-input::placeholder {
    color: var(--text-muted);
}

.currency-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.currency-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.currency-list-item:hover {
    background: var(--bg-body);
}

.currency-list-item.selected {
    background: rgba(99, 102, 241, 0.1);
}

.currency-list-item .currency-flag {
    font-size: 1.75rem;
}

.currency-list-item .currency-info {
    flex: 1;
}

.currency-list-item .currency-code {
    font-size: 1rem;
    font-weight: 600;
}

.currency-list-item .currency-name {
    font-size: 0.8125rem;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* ======================= RESPONSIVE ======================= */
@media (max-width: 991.98px) {
    .converter-section {
        padding: 1.5rem 0 3rem;
    }

    .converter-body {
        padding: 1.5rem;
    }

    .amount-input {
        font-size: 1.5rem;
    }

    .result-value {
        font-size: 2rem;
    }
}

@media (max-width: 767.98px) {
    .currency-selection {
        flex-direction: column;
        gap: 1rem;
    }

    .swap-btn {
        order: 2;
        margin: 0 auto;
    }

    .currency-box:first-child {
        order: 1;
    }

    .currency-box:last-child {
        order: 3;
    }

    .quick-amounts {
        gap: 0.375rem;
    }

    .quick-amount-btn {
        min-width: 60px;
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 575.98px) {
    .converter-header {
        padding: 1.25rem 1.25rem;
    }

    .converter-body {
        padding: 1.25rem;
    }

    .converter-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .converter-title {
        font-size: 1.125rem;
    }

    .amount-input {
        font-size: 1.25rem;
        padding: 0.875rem 1rem 0.875rem 2.5rem;
    }

    .currency-symbol {
        font-size: 1.25rem;
        left: 1rem;
    }

    .result-value {
        font-size: 1.75rem;
    }

    .result-currency {
        font-size: 1.25rem;
    }

    .features-section {
        padding: 3rem 0 4rem;
    }

    .section-title {
        font-size: 1.5rem;
    }
}