@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
    --bg-gradient: linear-gradient(135deg, #0f0c20 0%, #15102a 100%);
    --calc-bg: rgba(255, 255, 255, 0.05);
    --screen-bg: rgba(0, 0, 0, 0.3);
    --btn-num: rgba(255, 255, 255, 0.08);
    --btn-op: #ff2a74;
    --btn-fn: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --text-muted: #a0a0c0;
}

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

body {
    min-height: 100vh;
    background: var(--bg-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
}

/* حاوية الآلة الحاسبة بالتأثير الزجاجي الفخم */
.calculator-container {
    width: 360px;
    background: var(--calc-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* تصميم الشاشة وعرض التغييرات اللحظية */
.display-screen {
    background: var(--screen-bg);
    border-radius: 16px;
    padding: 20px;
    text-align: right;
    margin-bottom: 20px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    word-wrap: break-word;
    word-break: break-all;
}

.previous-operand {
    color: var(--text-muted);
    font-size: 1.1rem;
    min-height: 24px;
}

.current-operand {
    font-size: 2.2rem;
    font-weight: 500;
    overflow-x: auto;
    white-space: nowrap;
}

/* شبكة الأزرار وتوزيعها */
.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.btn {
    border: none;
    background: var(--btn-num);
    color: var(--text-color);
    font-size: 1.35rem;
    font-weight: 500;
    padding: 18px 0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(1px);
}

/* أزرار العمليات الحسابية */
.op-btn {
    background: rgba(255, 42, 116, 0.2);
    color: var(--btn-op);
}

.op-btn:hover {
    background: var(--btn-op);
    color: white;
}

/* أزرار الوظائف الخاصة AC, Del */
.fn-btn {
    background: var(--btn-fn);
}

/* زر اليساوي الممتد */
.equal-btn {
    grid-column: span 2;
    background: linear-gradient(135deg, #ff2a74 0%, #ff5e62 100%);
    border: none;
    color: white;
    font-size: 1.5rem;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.equal-btn:hover {
    box-shadow: 0 5px 15px rgba(255, 42, 116, 0.4);
    transform: translateY(-2px);
}

/* جعل تأثير الضغط على الكيبورد يظهر حركياً */
.btn.active-key {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(0.95);
}