/* Main Wrapper */
.crypto-converter-wrapper {
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    background: #fff;
}

.crypto-converter-wrapper h2 {
    margin: 0 0 8px 0;
    color: #1a1a1a;
    text-align: center;
    font-weight: 700;
    font-size: 1.75rem;
    line-height: 1.2;
}

.converter-subtitle {
    text-align: left;
    color: #4a5568;
    margin: 0 0 24px 0;
    font-size: 1rem;
    line-height: 1.5;
    max-width: 100%;
    padding: 0 4px;
}

#crypto-converter-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 8px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.amount-group {
    min-width: 240px;
}

/* Labels */
#crypto-converter-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.875rem;
    line-height: 1.25;
}

/* Input Stepper */
.input-stepper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-stepper:focus-within {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.stepper-input {
    flex: 1;
    width: 100%;
    padding: 12px 16px;
    border: none;
    font-size: 1rem;
    color: #1a202c;
    background: transparent;
    text-align: right;
    -moz-appearance: textfield;
    appearance: textfield;
    min-width: 0;
    height: 48px;
    outline: none;
}

/* Hide number input spinners */
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stepper-buttons {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-left: 1px solid #e2e8f0;
}

.stepper-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 50%;
    background: #f8fafc;
    border: none;
    color: #4a5568;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    position: relative;
}

.stepper-btn:first-child {
    border-bottom: 1px solid #e2e8f0;
}

.stepper-btn:hover {
    background: #f1f5f9;
    color: #2d3748;
}

.stepper-btn:active {
    background: #e2e8f0;
}

.stepper-btn svg {
    width: 14px;
    height: 14px;
}

.stepper-btn[data-action="decrease"] {
    border-bottom: 1px solid #e2e8f0;
}

.input-hint {
    display: block;
    color: #718096;
    font-size: 0.75rem;
    margin-top: 6px;
    line-height: 1.4;
}

/* Select Elements */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #4a5568;
    pointer-events: none;
}

#crypto-converter-form select {
    width: 100%;
    padding: 12px 36px 12px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9375rem;
    background-color: #fff;
    color: #1a202c;
    appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 48px;
}

#crypto-converter-form select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

/* Convert Button */
.convert-button {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.convert-button .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 8px;
}

.convert-button.loading .spinner {
    display: inline-block;
}

.convert-button.loading .button-text {
    visibility: hidden;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.convert-button:hover:not(:disabled) {
    background-color: #2c7a4d;
    transform: translateY(-1px);
}

.convert-button:active:not(:disabled) {
    transform: translateY(0);
}

.convert-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner Animation */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.convert-button.loading .spinner {
    display: inline-block;
}

.convert-button.loading .button-text {
    visibility: hidden;
}

#crypto-converter-form button[type="submit"]:disabled {
    background-color: #a0c4f0;
    cursor: not-allowed;
}

/* Result Card */
.conversion-result {
    margin-top: 24px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.conversion-result.visible {
    opacity: 1;
    transform: translateY(0);
}

.result-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.result-amount {
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}

.crypto-amount {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
}

.crypto-symbol {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4a5568;
    margin-left: 4px;
}

.equals {
    display: inline-block;
    margin: 0 8px;
    color: #a0aec0;
    font-weight: 500;
}

.fiat-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2f855a;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 0 24px;
}

.result-details {
    padding: 16px 24px 20px;
}

.exchange-rate {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.exchange-rate .label {
    color: #718096;
    font-size: 0.875rem;
}

.exchange-rate .rate {
    color: #4a5568;
    font-weight: 500;
    font-size: 0.9375rem;
}

.meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    color: #a0aec0;
    font-size: 0.75rem;
    line-height: 1.5;
    margin-top: 12px;
}

.source, .timestamp {
    display: inline-flex;
    align-items: center;
}

.source-name {
    font-weight: 500;
    margin-left: 2px;
}

.separator {
    margin: 0 6px;
    color: #e2e8f0;
}

.cache-indicator {
    display: inline-flex;
    align-items: center;
}

.cache-text {
    font-size: 0.75rem;
    color: #e53e3e;
    font-weight: 500;
    margin-left: 2px;
}

/* Error State */
.result-card.error {
    border-left: 4px solid #e53e3e;
}

.result-card.error .fiat-amount {
    color: #e53e3e;
}

/* Loading State */
.result-card.loading {
    position: relative;
    min-height: 120px;
}

.result-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2f855a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.conversion-amount {
    font-size: 22px;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 500;
}

.conversion-amount strong {
    color: #2ecc71;
    font-weight: 700;
}

.unit-price {
    color: #7f8c8d;
    margin-bottom: 15px;
    font-size: 15px;
}

.conversion-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #7f8c8d;
    border-top: 1px solid #e9ecef;
    padding-top: 12px;
    margin-top: 12px;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 20px;
    color: #4a90e2;
    font-weight: 500;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(74, 144, 226, 0.3);
    border-radius: 50%;
    border-top-color: #4a90e2;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error state */
.error {
    background-color: #fde8e8;
    color: #c53030;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #c53030;
    margin: 10px 0;
}

/* Cache badge */
.cache-badge {
    background-color: #e2e8f0;
    color: #4a5568;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: normal;
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 600px) {
    #crypto-converter-form {
        grid-template-columns: 1fr;
    }
    
    .crypto-converter-wrapper {
        padding: 15px;
    }
    
    .conversion-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .conversion-amount {
        font-size: 18px;
    }
}
