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

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

.container {
    max-width: 500px;
    width: 100%;
}

h1 {
    color: white;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-bottom: 30px;
    font-size: 0.9em;
}

.calculator {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.current-operation {
    font-size: 0.9em;
    opacity: 0.8;
    min-height: 20px;
    text-align: right;
}

.current-value {
    font-size: 2.5em;
    font-weight: 300;
    text-align: right;
    word-wrap: break-word;
    word-break: break-all;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.btn {
    border: none;
    border-radius: 10px;
    padding: 20px;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-number {
    background: #f8f9fa;
    color: #333;
}

.btn-number:hover {
    background: #e9ecef;
}

.btn-operator {
    background: #667eea;
    color: white;
}

.btn-operator:hover {
    background: #5568d3;
}

.btn-equals {
    background: #764ba2;
    color: white;
}

.btn-equals:hover {
    background: #663d8f;
}

.btn-clear {
    background: #ff6b6b;
    color: white;
}

.btn-clear:hover {
    background: #ee5a52;
}

.btn-delete {
    background: #ffa07a;
    color: white;
}

.btn-delete:hover {
    background: #ff8c61;
}

.history-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h2 {
    color: #333;
    font-size: 1.3em;
}

.btn-small {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-small:hover {
    background: #ee5a52;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn-small:active {
    transform: translateY(0);
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.no-history {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

.history-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.history-calculation {
    font-size: 1.1em;
    color: #333;
    font-weight: 500;
}

.history-time {
    font-size: 0.8em;
    color: #999;
}

/* Scrollbar styling */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Responsive design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .calculator {
        padding: 15px;
    }
    
    .current-value {
        font-size: 2em;
    }
    
    .btn {
        padding: 15px;
        font-size: 1.1em;
    }
}
