* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body {
    background-color: #f7f9fc;
    color: #333;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.calculator-container {
    width: 100%;
    max-width: 1000px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background-color: #4a6fa5;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 1px;
}

.content {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.graph-section {
    flex: 1;
    margin-bottom: 25px;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    overflow: hidden;
}

#graphCanvas {
    width: 100%;
    height: 400px;
    display: block;
    background-color: white;
    cursor: grab;
}

#graphCanvas:active {
    cursor: grabbing;
}

.input-section {
    margin-bottom: 20px;
}

.expression-input {
    width: 100%;
    padding: 15px;
    font-size: 20px;
    border: 2px solid #d1d9e6;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.expression-input:focus {
    border-color: #4a6fa5;
}

.buttons-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.button-group-title {
    font-size: 18px;
    font-weight: 600;
    color: #4a6fa5;
    margin-bottom: 5px;
    padding-left: 5px;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.calc-button {
    padding: 14px 5px;
    font-size: 18px;
    background-color: #f0f4f8;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: #333;
    font-weight: 500;
}

.calc-button:hover {
    background-color: #e1e8f0;
    transform: translateY(-2px);
}

.calc-button:active {
    transform: translateY(0);
}

.calc-button.operation {
    background-color: #e8eff7;
    color: #4a6fa5;
}

.calc-button.function {
    background-color: #f0f7f0;
    color: #2e7d32;
}

.calc-button.clear {
    background-color: #ffebee;
    color: #d32f2f;
}

.status {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
    text-align: center;
    min-height: 20px;
}

@media (max-width: 768px) {
    .content {
        padding: 15px;
    }

    .header {
        font-size: 24px;
        padding: 15px;
    }

    #graphCanvas {
        height: 300px;
    }

    .calc-button {
        padding: 12px 5px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .button-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .calc-button {
        padding: 10px 5px;
        font-size: 15px;
    }

    #graphCanvas {
        height: 250px;
    }
}