/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Calculator */
.calculator {
    border-radius: 15px;
    overflow: hidden;
    border: none;
}

.calculator .card-header {
    background: linear-gradient(135deg, #4A90E2 0%, #3a7bc8 100%) !important;
}

.display {
    background: #222222;
    border-radius: 10px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.display #expression {
    font-size: 1.2rem;
    min-height: 30px;
    word-wrap: break-word;
}

.display #result {
    font-size: 2.5rem;
    font-weight: 300;
    word-wrap: break-word;
}

/* Button Grid */
.button-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 15px;
}

.button-grid .btn {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.button-grid .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

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

.number-btn {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #e0e0e0;
}

.operator-btn {
    background: linear-gradient(135deg, #4A90E2 0%, #3a7bc8 100%);
    color: white;
    border: none;
}

.equals-btn {
    background: linear-gradient(135deg, #50C878 0%, #3eb465 100%);
    color: white;
    border: none;
    grid-column: span 2;
}

.clear-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #e55c5c 100%);
    color: white;
    border: none;
}

.memory-btn {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border: none;
}

/* History Cards */
.history-card {
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    background: white;
}

.history-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.history-card .result {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4A90E2;
}

/* Footer */
footer {
    margin-top: auto;
    background: linear-gradient(135deg, #2c3e50 0%, #1a2530 100%) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .button-grid {
        gap: 8px;
        padding: 10px;
    }
    
    .button-grid .btn {
        font-size: 1.2rem;
        padding: 0.5rem;
    }
    
    .display #result {
        font-size: 2rem;
    }
    
    .display #expression {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .button-grid .btn {
        font-size: 1rem;
        padding: 0.4rem;
    }
    
    .display #result {
        font-size: 1.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #4A90E2;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a7bc8;
}