:root {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --accent: #3498db;
    --border: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --success: #2ecc71;
}

[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --text-primary: #f5f5f5;
    --text-secondary: #bdc3c7;
    --border: #34495e;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

header h1 i {
    color: var(--accent);
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

.converter {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.currency-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.currency-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s;
}

.currency-btn:hover {
    border-color: var(--accent);
}

.currency-btn.active {
    border-color: var(--accent);
    background: rgba(52, 152, 219, 0.1);
}

.swap-icon {
    font-size: 1.2rem;
    color: var(--accent);
    cursor: pointer;
    transition: transform 0.3s;
}

.swap-icon:hover {
    transform: rotate(180deg);
}

.rate-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.rate-display button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 1rem;
}

.result {
    margin-bottom: 20px;
    font-size: 1.2rem;
    text-align: center;
    color: var(--text-primary);
}

#converted-amount {
    font-weight: bold;
    color: var(--accent);
    font-size: 1.5rem;
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn-secondary {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.btn-secondary:hover {
    border-color: var(--accent);
}

.history {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.history h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history h2 i {
    color: var(--accent);
}

#history-list {
    list-style: none;
    margin-bottom: 15px;
    max-height: 200px;
    overflow-y: auto;
}

#history-list li {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
}

#history-list li:last-child {
    border-bottom: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.modal-content h3 {
    margin-bottom: 20px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}