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

body {
    font-family: 'Montserrat', 'Roboto', Arial, sans-serif;
    background: #181a20;
    min-height: 100vh;
    color: #f5f6fa;
}

.currency-converter {
    min-height: 100vh;
    padding: 40px 8%;
    background: #181a20;
}

.converter-header {
    text-align: center;
    margin-bottom: 50px;
}

.converter-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 18px;
    color: #f5f6fa;
}

.converter-header h1 span {
    color: #ffb347;
}

.converter-header p {
    font-size: 1.3rem;
    color: #b2becd;
}

.converter-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.currency-input {
    background: #23263a;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid #353866;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    min-width: 250px;
    flex: 1;
}

.currency-input label {
    display: block;
    margin-bottom: 15px;
    color: #ffb347;
    font-weight: 600;
    font-size: 1.1rem;
}

.input-group {
    display: flex;
    gap: 10px;
}

.amount-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #353866;
    border-radius: 12px;
    background: #181a20;
    color: #f5f6fa;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.amount-input:focus {
    outline: none;
    border-color: #ffb347;
    box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.2);
}

.amount-input.result {
    background: #353866;
    color: #ffb347;
    font-weight: 700;
}

.currency-select {
    padding: 15px;
    border: 2px solid #353866;
    border-radius: 12px;
    background: #181a20;
    color: #f5f6fa;
    font-size: 14px;
    min-width: 120px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.currency-select:focus {
    outline: none;
    border-color: #ffb347;
}

.swap-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.swap-btn {
    background: #ffb347;
    color: #23263a;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.swap-btn:hover {
    background: #fff;
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 179, 71, 0.4);
}

.conversion-result {
    text-align: center;
    margin-bottom: 50px;
}

.result-display {
    background: #23263a;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    border: 2px solid #ffb347;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
}

.from-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: #f5f6fa;
}

.equals {
    font-size: 1.5rem;
    color: #ffb347;
}

.to-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #ffb347;
}

.add-history-btn {
    background: transparent;
    color: #ffb347;
    border: 2px solid #ffb347;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-history-btn:hover:not(:disabled) {
    background: #ffb347;
    color: #23263a;
}

.add-history-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.favorites-section {
    margin-bottom: 50px;
}

.favorites-section h3 {
    color: #ffb347;
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.favorite-card {
    background: #23263a;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #353866;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.favorite-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 179, 71, 0.2);
    border-color: #ffb347;
}

.currency-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.flag {
    font-size: 1.5rem;
}

.code {
    font-weight: 700;
    color: #f5f6fa;
}

.converted-value {
    color: #ffb347;
    font-weight: 600;
    font-size: 1.1rem;
}

.history-section {
    margin-bottom: 50px;
}

.history-section h3 {
    color: #ffb347;
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
}

.history-list {
    max-width: 600px;
    margin: 0 auto;
}

.history-item {
    background: #23263a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #353866;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.conversion-info span {
    display: block;
    font-weight: 600;
    color: #f5f6fa;
    margin-bottom: 5px;
}

.conversion-info small {
    color: #b2becd;
    font-size: 0.9rem;
}

.rate-info {
    color: #ffb347;
    font-size: 0.9rem;
    font-weight: 500;
}

.return-section {
    margin-top: 40px;
    text-align: center;
}

.return-btn {
    background: transparent;
    color: #b2becd;
    border: 2px solid #353866;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.return-btn:hover {
    background: #353866;
    color: #ffb347;
    border-color: #ffb347;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(53, 56, 102, 0.4);
}

/* Ensure scrollbars work properly */
::-webkit-scrollbar {
    width: 10px;
}
    
::-webkit-scrollbar-track {
    background: #181a20;
}
    
::-webkit-scrollbar-thumb {
    background: #ffb347;
    border-radius: 4px;
}
    
::-webkit-scrollbar-thumb:hover {
    background: #ff8c42;
}

/* Responsividade */
@media (max-width: 768px) {
    .converter-main {
        flex-direction: column;
        gap: 20px;
    }

    .currency-input {
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .input-group {
        flex-direction: column;
        gap: 10px;
    }

    .amount-input, .currency-select {
        width: 100%;
        min-width: 0;
    }

    .swap-btn {
        transform: rotate(90deg);
    }

    .swap-btn:hover {
        transform: rotate(270deg) scale(1.1);
    }

    .result-display {
        flex-direction: column;
        gap: 15px;
        padding: 25px 20px;
    }

    .from-amount, .to-amount {
        font-size: 1.5rem;
    }

    .favorites-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .history-item {
        flex-direction: column;
        text-align: center;
    }

    .converter-header h1 {
        font-size: 2.2rem;
    }

    .converter-header p {
        font-size: 1.1rem;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-item {
    animation: fadeIn 0.5s ease;
}