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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 1000px;
    width: 100%;
    backdrop-filter: blur(10px);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    color: #666;
    font-size: 1.1em;
}

h2 {
    color: #764ba2;
    margin-bottom: 20px;
    font-size: 1.6em;
}

.converter-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.converter-input {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

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

input[type="number"] {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.currency-select, .base-currency-select {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.currency-select:hover, .base-currency-select:hover {
    border-color: #667eea;
}

.swap-button {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.swap-button:hover {
    transform: rotate(180deg);
    background: #764ba2;
}

.exchange-rate-info {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
}

#exchangeRateDisplay {
    font-size: 1.3em;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 10px;
}

#lastUpdateTime {
    color: #999;
    font-size: 0.9em;
}

.rates-table-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.rates-table {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.rate-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.rate-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.rate-currency {
    font-weight: bold;
    color: #764ba2;
    font-size: 1.2em;
    margin-bottom: 5px;
}

.rate-value {
    color: #333;
    font-size: 1.1em;
}

.chart-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

#rateChart {
    max-height: 400px;
}

.favorites-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.favorite-controls {
    margin-bottom: 20px;
}

.add-favorite-btn {
    background: #764ba2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-favorite-btn:hover {
    background: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.favorites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.favorite-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.favorite-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.favorite-pair {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

.favorite-rate {
    color: #333;
}

.remove-favorite {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.remove-favorite:hover {
    background: #ff5252;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: #666;
    font-size: 0.9em;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .converter-input {
        flex-direction: column;
    }
    
    .currency-input {
        width: 100%;
    }
    
    .swap-button {
        transform: rotate(90deg);
    }
    
    .swap-button:hover {
        transform: rotate(270deg);
    }
    
    .rates-table {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

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

.error-message {
    background: #ff6b6b;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
}