* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    padding: 20px;
}

.calculator-header {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #00c6ff;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: #00c6ff;
    color: #0f2027;
    transform: translateX(-5px);
}

.calculator-header h1 {
    font-size: 2rem;
    text-align: center;
}

.calculator-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    max-width: 500px;
    width: 100%;
    margin-top: 80px;
}

.display-box {
    margin-bottom: 20px;
}

.display {
    width: 100%;
    padding: 20px;
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #00c6ff;
    border-radius: 10px;
    color: #00c6ff;
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    box-shadow: inset 0 0 10px rgba(0, 198, 255, 0.2);
}

.display:focus {
    outline: none;
    box-shadow: inset 0 0 20px rgba(0, 198, 255, 0.4);
}

/* History Box */
.history-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 150px;
    overflow-y: auto;
}

.history-box h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #00c6ff;
    text-transform: uppercase;
}

.history-list {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    max-height: 100px;
    overflow-y: auto;
}

.history-item {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Courier New', monospace;
}

.history-item:last-child {
    border-bottom: none;
}

.clear-history-btn {
    width: 100%;
    padding: 8px;
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.clear-history-btn:hover {
    background: rgba(255, 107, 107, 0.4);
}

/* Buttons Grid */
.buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.btn {
    padding: 20px 10px;
    font-size: 1.2rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 198, 255, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.operator-btn {
    background: rgba(0, 198, 255, 0.2);
    color: #00c6ff;
    border-color: #00c6ff;
    font-weight: bold;
}

.operator-btn:hover {
    background: rgba(0, 198, 255, 0.4);
    box-shadow: 0 5px 15px rgba(0, 198, 255, 0.5);
}

.equals-btn {
    background: linear-gradient(135deg, #00c6ff, #00a8cc);
    color: #0f2027;
    font-weight: bold;
    grid-column: span 1;
}

.equals-btn:hover {
    box-shadow: 0 5px 20px rgba(0, 198, 255, 0.6);
}

.function-btn {
    background: rgba(255, 107, 107, 0.2);
    color: #ff9999;
    border-color: rgba(255, 107, 107, 0.5);
}

.function-btn:hover {
    background: rgba(255, 107, 107, 0.4);
}

.science-btn {
    background: rgba(255, 200, 87, 0.2);
    color: #ffc857;
    border-color: rgba(255, 200, 87, 0.5);
    font-size: 1rem;
}

.science-btn:hover {
    background: rgba(255, 200, 87, 0.4);
}

.zero-btn {
    grid-column: span 2;
}

/* Scrollbar Style */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(0, 198, 255, 0.3);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 198, 255, 0.5);
}

/* Responsive */
@media (max-width: 480px) {
    .calculator-header {
        position: static;
        flex-direction: column;
        text-align: center;
        margin-bottom: 20px;
    }

    .calculator-header h1 {
        font-size: 1.5rem;
    }

    .calculator-container {
        margin-top: 0;
        padding: 20px;
        max-width: 100%;
    }

    .display {
        font-size: 2rem;
        padding: 15px;
    }

    .btn {
        padding: 15px 8px;
        font-size: 1rem;
    }

    .history-box {
        margin-bottom: 15px;
    }
}
