/* Premium Calculator Styles */
.pmc-calculator-container {
    max-width: 100%;
    width: 350px;
    margin: 20px auto;
    background: linear-gradient(145deg, #f0f0f0, #ffffff);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 15px 15px 30px #d9d9d9, -15px -15px 30px #ffffff;
    font-family: 'Segoe UI', system-ui, sans-serif;
    transition: all 0.3s ease;
}

/* Display Area */
.pmc-display-area {
    background: #1a1a2e;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: right;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
}

.pmc-memory-display {
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 14px;
    color: #00ff88;
    font-weight: 500;
}

.pmc-expression {
    font-size: 18px;
    color: #8a8a8a;
    min-height: 24px;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pmc-result {
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 10px rgba(0, 255, 136, 0.3);
}

/* Memory Buttons */
.pmc-memory-buttons {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

/* Main Buttons Grid */
.pmc-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* Button Base Styles */
.pmc-btn {
    border: none;
    border-radius: 12px;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 18px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    position: relative;
    overflow: hidden;
    outline: none;
}

.pmc-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.pmc-btn:active::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(40, 40);
        opacity: 0;
    }
}

/* Button Types */
.pmc-number-btn {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    color: #2d3436;
    box-shadow: 5px 5px 10px #d1d9e6, -5px -5px 10px #ffffff;
}

.pmc-number-btn:hover {
    background: linear-gradient(145deg, #ffffff, #e9ecef);
    transform: translateY(-2px);
    box-shadow: 8px 8px 16px #d1d9e6, -8px -8px 16px #ffffff;
}

.pmc-zero-btn {
    grid-column: span 2;
}

.pmc-operator-btn {
    background: linear-gradient(145deg, #4dabf7, #339af0);
    color: white;
    box-shadow: 5px 5px 10px #d1d9e6, -5px -5px 10px #ffffff;
}

.pmc-operator-btn:hover {
    background: linear-gradient(145deg, #339af0, #228be6);
    transform: translateY(-2px);
    box-shadow: 8px 8px 16px #d1d9e6, -8px -8px 16px #ffffff;
}

.pmc-clear-btn {
    background: linear-gradient(145deg, #ff6b6b, #fa5252);
    color: white;
    box-shadow: 5px 5px 10px #d1d9e6, -5px -5px 10px #ffffff;
}

.pmc-clear-btn:hover {
    background: linear-gradient(145deg, #fa5252, #e03131);
    transform: translateY(-2px);
}

.pmc-equals-btn {
    background: linear-gradient(145deg, #40c057, #2f9e44);
    color: white;
    box-shadow: 5px 5px 10px #d1d9e6, -5px -5px 10px #ffffff;
    grid-column: span 2;
}

.pmc-equals-btn:hover {
    background: linear-gradient(145deg, #2f9e44, #2b8a3e);
    transform: translateY(-2px);
    box-shadow: 8px 8px 16px #d1d9e6, -8px -8px 16px #ffffff;
}

.pmc-decimal-btn {
    background: linear-gradient(145deg, #a9e34b, #94d82d);
    color: white;
    box-shadow: 5px 5px 10px #d1d9e6, -5px -5px 10px #ffffff;
}

.pmc-decimal-btn:hover {
    background: linear-gradient(145deg, #94d82d, #82c91e);
    transform: translateY(-2px);
}

.pmc-memory-btn, .pmc-adv-btn {
    background: linear-gradient(145deg, #7950f2, #6741d9);
    color: white;
    font-size: 16px;
    padding: 12px 5px;
    box-shadow: 5px 5px 10px #d1d9e6, -5px -5px 10px #ffffff;
}

.pmc-memory-btn:hover, .pmc-adv-btn:hover {
    background: linear-gradient(145deg, #6741d9, #5f3dc4);
    transform: translateY(-2px);
}

/* Advanced Functions */
.pmc-advanced-functions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
    animation: fadeIn 0.3s ease;
}

.pmc-toggle-adv {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: linear-gradient(145deg, #495057, #343a40);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pmc-toggle-adv:hover {
    background: linear-gradient(145deg, #343a40, #212529);
    transform: translateY(-2px);
}

/* Size Variations */
.pmc-size-small {
    width: 280px;
    padding: 15px;
}

.pmc-size-small .pmc-btn {
    padding: 12px 5px;
    font-size: 18px;
}

.pmc-size-small .pmc-result {
    font-size: 36px;
}

.pmc-size-large {
    width: 450px;
    padding: 30px;
}

.pmc-size-large .pmc-btn {
    padding: 25px 5px;
    font-size: 26px;
}

.pmc-size-large .pmc-result {
    font-size: 56px;
}

/* Theme Variations */
.pmc-theme-blue .pmc-display-area {
    background: linear-gradient(135deg, #1a237e, #283593);
}

.pmc-theme-dark {
    background: linear-gradient(145deg, #2d3436, #1a1a1a);
    color: white;
}

.pmc-theme-dark .pmc-display-area {
    background: linear-gradient(135deg, #0c2461, #1e3799);
}

.pmc-theme-dark .pmc-number-btn {
    background: linear-gradient(145deg, #4a5568, #2d3748);
    color: white;
}

.pmc-theme-modern {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border: 2px solid #e9ecef;
}

.pmc-theme-modern .pmc-display-area {
    background: white;
    border: 2px solid #dee2e6;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pmc-btn-active {
    animation: pop 0.2s ease;
}

/* Responsive Design */
@media (max-width: 480px) {
    .pmc-calculator-container {
        width: 100%;
        max-width: 100%;
        padding: 15px;
        margin: 10px auto;
        border-radius: 15px;
    }
    
    .pmc-buttons-grid {
        gap: 10px;
    }
    
    .pmc-btn {
        padding: 16px 5px;
        font-size: 20px;
        border-radius: 10px;
    }
    
    .pmc-result {
        font-size: 36px;
    }
    
    .pmc-memory-buttons {
        grid-template-columns: repeat(3, 1fr);
        margin-bottom: 15px;
    }
    
    .pmc-memory-btn, .pmc-adv-btn {
        font-size: 14px;
        padding: 10px 5px;
    }
}

@media (max-width: 360px) {
    .pmc-calculator-container {
        padding: 10px;
    }
    
    .pmc-buttons-grid {
        gap: 8px;
    }
    
    .pmc-btn {
        padding: 14px 5px;
        font-size: 18px;
    }
    
    .pmc-result {
        font-size: 32px;
    }
    
    .pmc-expression {
        font-size: 16px;
    }
}

/* Loading Animation */
.pmc-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.pmc-error {
    color: #ff6b6b !important;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}