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

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

.calculator-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.calculator {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.display {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 40px 30px 30px;
    text-align: right;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.previous-operand {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    min-height: 27px;
}

.current-operand {
    font-size: 48px;
    font-weight: 300;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.btn {
    border: none;
    background: white;
    padding: 25px 0;
    font-size: 24px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn:active::before {
    width: 100px;
    height: 100px;
}

.btn:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

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

.btn.operator {
    background: #f8f9fa;
    color: #667eea;
    font-weight: 600;
}

.btn.operator:hover {
    background: #e9ecef;
}

.btn.equals {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    grid-column: span 2;
    font-weight: 600;
}

.btn.equals:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
}

.btn[data-action="clear"] {
    color: #e74c3c;
}

.btn[data-action="delete"] {
    color: #f39c12;
}

.btn[data-action="percent"] {
    color: #27ae60;
}

/* Responsive tasarım */
@media (max-width: 480px) {
    .calculator-container {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .calculator {
        border-radius: 20px;
    }
    
    .display {
        padding: 30px 20px 20px;
        min-height: 100px;
    }
    
    .current-operand {
        font-size: 36px;
    }
    
    .previous-operand {
        font-size: 16px;
    }
    
    .btn {
        padding: 20px 0;
        font-size: 20px;
    }
}

@media (max-width: 360px) {
    .display {
        padding: 25px 15px 15px;
    }
    
    .current-operand {
        font-size: 32px;
    }
    
    .btn {
        padding: 18px 0;
        font-size: 18px;
    }
}

/* Karanlık tema desteği */
@media (prefers-color-scheme: dark) {
    .calculator {
        background: rgba(30, 30, 30, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .btn {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .btn:hover {
        background: #3a3a3a;
    }
    
    .btn.operator {
        background: #3a3a3a;
        color: #667eea;
    }
    
    .btn.operator:hover {
        background: #4a4a4a;
    }
}
