

.currency-rate {
    font-weight: 600;
    color: #27ae60;
}

.currency-code {
    font-weight: bold;
    color: #34495e;
    margin-right: 5px;
}

.currency-name {
    font-style: italic;
    color: #7f8c8d;
    font-size: 0.9em;
}

.currency-full {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.currency-error {
    color: #e74c3c;
    font-weight: bold;
}

.currency-calculator {
    max-width: 800px;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: visible;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.exchange-rate-display {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.rate-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.currency-from,
.currency-to {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2em;
    font-weight: 600;
}

.currency-flag {
    font-size: 1.5em;
}

.currency-code {
    color: #495057;
    font-weight: bold;
}

.currency-amount {
    color: #2c3e50;
    font-weight: bold;
}

.conversion-arrow {
    font-size: 1.5em;
    color: #007bff;
    font-weight: bold;
}

.rate-details {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 0.9em;
    color: #6c757d;
}

.rate-text {
    font-style: italic;
}

.rate-value {
    font-weight: bold;
    color: #28a745;
}

.calculator-block {
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
}

.amount-input {
    flex: 1;
    min-width: 200px;
}

.calc-amount {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1.3em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #f8f9fa;
    color: #2c3e50;
}

.calc-amount:focus {
    outline: none;
    border-color: #007bff;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.calc-amount::placeholder {
    color: #6c757d;
    font-weight: normal;
}

.currency-from-select,
.currency-to-select {
    min-width: 120px;
    position: relative;
    overflow: visible;
}

.custom-select {
    position: relative;
    width: 100%;
    overflow: visible;
}

.currency-calculator .select-dropdown {
    display: none !important;
    opacity: 0;
    visibility: hidden;
}

.select-dropdown:not(.show) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.select-trigger {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1em;
    font-weight: 600;
    color: #495057;
    box-sizing: border-box;
}

.select-trigger:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.select-trigger.active {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.currency-flag {
    font-size: 1.2em;
    margin-right: 8px;
}

.currency-code {
    flex: 1;
    font-weight: 600;
}

.select-arrow {
    font-size: 0.8em;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.select-trigger.active .select-arrow {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e1e8ed;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 300px;
    overflow-y: auto;
    display: none !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-width: 350px;
    width: 350px;
}

.select-dropdown.show {
    display: block !important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.select-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
    min-height: 45px;
}

.select-option:last-child {
    border-bottom: none;
}

.select-option:hover {
    background-color: #f8f9fa;
}

.select-option.selected {
    background-color: #e3f2fd;
    color: #1976d2;
}

.select-option .currency-flag {
    font-size: 1em;
    margin-right: 8px;
    min-width: 18px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 0.8em;
}

/* Стили для SVG флагов */
.currency-flag-svg {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    vertical-align: middle;
}

.currency-flag-text {
    font-size: 0.8em;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    vertical-align: middle;
}

.select-option .currency-name {
    font-size: 0.9em;
    color: #495057;
    white-space: normal;
    word-wrap: break-word;
    min-width: 0;
    line-height: 1.2;
}

.select-option .currency-code {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: 500;
    margin-left: 4px;
    flex-shrink: 0;
    min-width: 35px;
    width: 35px;
    text-align: right;
}

.select-option.selected .currency-name,
.select-option.selected .currency-code {
    color: #1976d2;
}

/* Кнопка смены валют */
.swap-button {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-currencies {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.swap-currencies:hover {
    background: #5a6268;
    transform: scale(1.1);
}

.swap-currencies:active {
    transform: scale(0.95);
}

/* Кнопка конвертации */
.convert-button {
    min-width: 150px;
}

.convert-currency {
    background: #6c757d;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.convert-currency:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.convert-currency:active {
    transform: translateY(0);
}

.result-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #27ae60;
}

.conversion-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.original-amount,
.converted-amount {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.original-amount .amount,
.converted-amount .amount {
    font-size: 1.5em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.original-amount .currency,
.converted-amount .currency {
    font-size: 1em;
    color: #7f8c8d;
    font-weight: 600;
    padding: 4px 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e1e8ed;
}

.conversion-arrow {
    font-size: 1.5em;
    color: #3498db;
    font-weight: bold;
}

.exchange-rate {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9em;
    font-style: italic;
}

.error-message {
    color: #e74c3c;
    text-align: center;
    font-weight: 600;
    padding: 10px;
    background: #fdf2f2;
    border-radius: 5px;
    border: 1px solid #fecaca;
}

/* Адаптивность */
@media (max-width: 768px) {
    .currency-calculator {
        margin: 10px;
        border-radius: 8px;
    }
    
    .exchange-rate-display {
        padding: 15px;
    }
    
    .rate-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .rate-details {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .calculator-block {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .amount-input,
    .currency-from-select,
    .currency-to-select,
    .convert-button {
        width: 100%;
        min-width: auto;
    }
    
    .currency-from-select,
    .currency-to-select {
        min-width: 120px;
    }
    
    .swap-button {
        order: 4;
    }
    
    .conversion-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 480px) {
    .calculator-header h3 {
        font-size: 1.2em;
    }
    
    .calc-amount {
        font-size: 1em;
        padding: 12px;
    }
    
    .convert-currency {
        padding: 12px 20px;
        font-size: 1em;
    }
    
    .original-amount .amount,
    .converted-amount .amount {
        font-size: 1.2em;
    }
    
    .currency-from-select,
    .currency-to-select {
        min-width: 120px;
    }
    
    .select-option .currency-name {
        font-size: 0.85em;
    }
    
    .select-option .currency-code {
        font-size: 0.8em;
        min-width: 40px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-container {
    animation: fadeIn 0.3s ease-out;
}

/* Стили для загрузки */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Адаптивные стили для выпадающих списков */
@media (max-width: 768px) {
    .select-dropdown {
        width: 100%;
        min-width: 100%;
        max-width: calc(100vw - 40px);
    }
}

@media (max-width: 480px) {
    .select-dropdown {
        width: 100%;
        min-width: 100%;
        max-width: calc(100vw - 20px);
    }
    
    .select-option {
        padding: 8px 10px;
        min-height: 40px;
    }
    
    .select-option .currency-name {
        font-size: 0.85em;
    }
    
    .select-option .currency-code {
        font-size: 0.8em;
        min-width: 40px;
    }
}
