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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 10px;
}

h1 {
    font-size: 32px;
    color: #2c3e50;
    font-weight: 700;
}

#theme-toggle {
    position: absolute;
    right: 0;
    padding: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle:hover {
    transform: translateY(-2px);
}

.theme-icon-light,
.theme-icon-dark {
    font-size: 18px;
    color: #2c3e50;
}

.theme-icon-dark {
    display: none;
}

body.dark-mode .theme-icon-light {
    display: none;
}

body.dark-mode .theme-icon-dark {
    display: inline;
}

.calculators {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.calculator {
    width: 100%;
}

h2 {
    font-size: 24px;
    color: #667eea;
    margin-bottom: 25px;
    font-weight: 600;
}

form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    text-align: left;
    margin-bottom: 6px;
    display: block;
}

#tc-market-price-group {
    display: flex;
    flex-direction: column;
}

#tc-market-price-group label {
    text-align: left;
}

.select-with-swap {
    display: flex;
    gap: 10px;
    align-items: center;
}

.select-with-swap select {
    flex: 1;
}

#swap-button {
    padding: 14px 16px;
    font-size: 18px;
    min-width: auto;
    width: auto;
    transition: transform 0.3s ease;
}

#swap-button.rotating {
    transform: rotate(180deg);
}

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

.input-group input {
    flex: 1;
    min-width: 0;
}

.input-group select {
    flex: 0 0 90px;
    width: 90px;
}

input, select {
    padding: 14px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    width: 100%;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input::placeholder {
    color: #a0a0a0;
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 10px;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

#reset-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

#reset-button:hover {
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.result-actions button {
    flex: 1;
}

.copy-button {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.3);
}

.copy-button:hover {
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.4);
}

.copy-button.copied {
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
}

.result {
    margin-top: 30px;
    padding: 25px;
    font-size: 16px;
    line-height: 1.8;
    color: #2c3e50;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 1;
    transform: translateY(0);
}

.result.show {
    opacity: 1;
    transform: translateY(0);
}

/* Conversion result row */
.conversion-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.result-value {
    font-weight: 700;
    font-size: 18px;
    transition: color 0.3s ease;
}

.result-value.placeholder {
    color: #a0a0a0;
}

.result-equals {
    color: #667eea;
    font-weight: 600;
    font-size: 18px;
}

/* Currency section */
.currency-section {
    margin-top: 8px;
}

.currency-label {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}


footer {
    margin-top: 30px;
    font-size: 13px;
    color: #7f8c8d;
    text-align: center;
}

footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #764ba2;
}

/* Currency grid for results */
.currency-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.currency-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 10px 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.currency-item.highlighted {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(102, 126, 234, 0);
    }
}

.currency-item .amount {
    font-weight: 700;
    font-size: 16px;
    display: block;
    transition: color 0.3s ease;
}

.currency-item.placeholder .amount {
    color: #a0a0a0;
}

.currency-item .code {
    font-size: 12px;
    opacity: 0.8;
}

/* Responsive design for mobile */
@media (max-width: 640px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 26px;
    }

    h2 {
        font-size: 20px;
    }

    input, select, button {
        font-size: 14px;
    }

    .button-group {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    .currency-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Dark mode styles */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .container {
    background-color: #1f1f1f;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

body.dark-mode h1,
body.dark-mode label {
    color: #e0e0e0;
}

body.dark-mode input,
body.dark-mode select {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-mode input:focus,
body.dark-mode select:focus {
    background-color: #333333;
    border-color: #667eea;
}

body.dark-mode input::placeholder {
    color: #808080;
}

body.dark-mode .result {
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    color: #e0e0e0;
}

body.dark-mode .currency-item {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

body.dark-mode .currency-item.placeholder .amount {
    color: #606060;
}

body.dark-mode .result-value.placeholder {
    color: #606060;
}

body.dark-mode .currency-item.highlighted {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body.dark-mode #theme-toggle {
    background: #333333;
}

body.dark-mode .theme-icon-dark {
    color: #e0e0e0;
}

body.dark-mode footer {
    color: #808080;
}
