body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
}

.calculator-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-button {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid #00d2ff;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.currency-container, .size-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.currency-container input, .currency-container select,
.size-container input, .size-container select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.currency-container select, .size-container select {
    cursor: pointer;
}

.result-display {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-align: center;
    color: #00d2ff;
    font-size: 18px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.background-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(40px, 10vw, 80px);
    color: rgba(0, 210, 255, 0.03);
    z-index: 0;
    pointer-events: none;
    font-weight: bold;
    letter-spacing: 5px;
}

.display-container {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

#formula, #display {
    width: 100%;
    text-align: right;
    border: none;
    background: transparent;
    padding: 0 5px;
    box-sizing: border-box;
    font-family: 'Courier New', Courier, monospace;
    cursor: default;
    outline: none;
}

#formula {
    height: 24px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

#display {
    height: 40px;
    font-size: 28px;
    color: #ffffff;
    font-weight: 500;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    z-index: 1;
}

button {
    padding: 15px 10px;
    font-size: 16px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.number-button {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.number-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.operator-button {
    background: rgba(255, 165, 0, 0.3);
    color: #ffffff;
    border-color: rgba(255, 165, 0, 0.5);
}

.operator-button:hover {
    background: rgba(255, 165, 0, 0.4);
    border-color: rgba(255, 165, 0, 0.6);
}

.function-button {
    background: rgba(94, 92, 230, 0.3);
    color: #ffffff;
    font-size: 14px;
    border-color: rgba(94, 92, 230, 0.5);
}

.function-button:hover {
    background: rgba(94, 92, 230, 0.4);
    border-color: rgba(94, 92, 230, 0.6);
}

.equal-button {
    background: rgba(48, 209, 88, 0.3);
    color: #ffffff;
    grid-column: span 2;
    border-color: rgba(48, 209, 88, 0.5);
}

.equal-button:hover {
    background: rgba(48, 209, 88, 0.4);
    border-color: rgba(48, 209, 88, 0.6);
}

.history-panel {
    width: 250px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 20px;
    height: 500px;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.history-panel h3 {
    margin-top: 0;
    color: #00d2ff;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

#history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

#history-list li {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    color: #ffffff;
}

#history-list li:hover {
    background: rgba(255, 255, 255, 0.1);
}

.clear-history {
    background: rgba(255, 59, 48, 0.3);
    border: 1px solid rgba(255, 59, 48, 0.5);
    color: #ffffff;
    padding: 8px;
    border-radius: 8px;
    margin-top: 10px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.clear-history:hover {
    background: rgba(255, 59, 48, 0.4);
    border-color: rgba(255, 59, 48, 0.6);
}

footer {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    font-size: 12px;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .calculator-container {
        flex-direction: column;
        align-items: center;
    }

    .history-panel {
        width: 360px;
        height: 200px;
    }
}

@media (max-width: 480px) {
    body {
        align-items: flex-start;
        background: #000000;
    }
    .calculator-container {
        padding: 0;
        width: 100%;
        flex-direction: column;
    }
    .calculator {
        border-radius: 0;
        width: 100%;
        height: auto;
        border: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(0, 0, 0, 0.8);
        margin-bottom: 20px;
    }
    .history-panel {
        width: 100%;
        height: 200px;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.05);
    }
}
