/**
 * Calculator24 Basic Calculator Styles
 * Modern Windows-inspired calculator
 */

.calc24-calculator {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 20px auto;
    max-width: 500px;
    min-width: 280px;
}

.calc24-container {
    background: #1e1e1e;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Theme Variations */
.calc24-theme-light .calc24-container {
    background: #f5f5f5;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.calc24-theme-dark .calc24-container {
    background: #1e1e1e;
}

/* Header Styles */
.calc24-header {
    margin-bottom: 20px;
}

.calc24-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.calc24-title span {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.calc24-theme-light .calc24-title span {
    color: #333333;
}

.calc24-history-toggle {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.calc24-theme-light .calc24-history-toggle {
    color: #666666;
}

.calc24-history-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* History Panel */
.calc24-history-panel {
    background: #2d2d2d;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

.calc24-theme-light .calc24-history-panel {
    background: #e8e8e8;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calc24-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.2);
    color: #ffffff;
    font-size: 14px;
}

.calc24-theme-light .calc24-history-header {
    color: #333333;
    background: rgba(0, 0, 0, 0.05);
}

.calc24-history-clear {
    background: none;
    border: none;
    color: #0078d4;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.calc24-history-clear:hover {
    background: rgba(0, 120, 212, 0.1);
}

.calc24-history-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
}

.calc24-history-item {
    padding: 8px 12px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #cccccc;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.calc24-theme-light .calc24-history-item {
    background: rgba(0, 0, 0, 0.05);
    color: #666666;
}

.calc24-history-item:hover {
    background: rgba(0, 120, 212, 0.2);
    transform: translateX(5px);
}

/* Display Area */
.calc24-display {
    background: #2d2d2d;
    border-radius: 12px;
    padding: 20px;
    text-align: right;
    margin-bottom: 20px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.calc24-theme-light .calc24-display {
    background: #e8e8e8;
}

.calc24-expression {
    color: #a0a0a0;
    font-size: 16px;
    margin-bottom: 10px;
    min-height: 24px;
    word-wrap: break-word;
    word-break: break-all;
}

.calc24-theme-light .calc24-expression {
    color: #888888;
}

.calc24-result {
    color: #ffffff;
    font-size: 36px;
    font-weight: 500;
    word-wrap: break-word;
    word-break: break-all;
    line-height: 1.2;
}

.calc24-theme-light .calc24-result {
    color: #333333;
}

/* Button Grid */
.calc24-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

/* Button Styles */
.calc24-btn {
    background: #2d2d2d;
    border: none;
    border-radius: 12px;
    padding: 20px 5px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ffffff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.calc24-theme-light .calc24-btn {
    background: #ffffff;
    color: #333333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.calc24-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.calc24-btn:active::before {
    width: 100%;
    height: 100%;
}

.calc24-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.calc24-btn:active {
    transform: translateY(0);
}

/* Number Buttons */
.calc24-number {
    background: #2d2d2d;
}

.calc24-theme-light .calc24-number {
    background: #f8f8f8;
}

/* Operator Buttons */
.calc24-operator {
    background: #0078d4;
    color: #ffffff;
}

.calc24-theme-light .calc24-operator {
    background: #0078d4;
    color: #ffffff;
}

.calc24-operator:hover {
    background: #0086e6;
}

/* Function Buttons */
.calc24-fn {
    background: #3d3d3d;
}

.calc24-theme-light .calc24-fn {
    background: #f0f0f0;
}

/* Clear Buttons */
.calc24-clear {
    background: #d83b01;
    color: #ffffff;
}

.calc24-clear:hover {
    background: #d83b01dd;
}

/* Equals Button */
.calc24-equals {
    background: #107c10;
    color: #ffffff;
}

.calc24-equals:hover {
    background: #118a11;
}

/* Footer */
.calc24-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.calc24-sound-toggle,
.calc24-copy-result {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.2s;
    color: #ffffff;
}

.calc24-theme-light .calc24-sound-toggle,
.calc24-theme-light .calc24-copy-result {
    color: #666666;
}

.calc24-sound-toggle:hover,
.calc24-copy-result:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Notification */
.calc24-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .calc24-container {
        padding: 15px;
    }
    
    .calc24-buttons {
        gap: 8px;
    }
    
    .calc24-btn {
        padding: 15px 5px;
        font-size: 16px;
    }
    
    .calc24-result {
        font-size: 28px;
    }
    
    .calc24-expression {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .calc24-container {
        padding: 12px;
    }
    
    .calc24-buttons {
        gap: 6px;
    }
    
    .calc24-btn {
        padding: 12px 5px;
        font-size: 14px;
    }
    
    .calc24-title span {
        font-size: 16px;
    }
}

/* Touch Device Optimization */
@media (hover: none) and (pointer: coarse) {
    .calc24-btn {
        padding: 18px 5px;
    }
    
    .calc24-btn:hover {
        transform: none;
    }
}

/* Scrollbar Styling */
.calc24-history-list::-webkit-scrollbar {
    width: 6px;
}

.calc24-history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.calc24-history-list::-webkit-scrollbar-thumb {
    background: #0078d4;
    border-radius: 10px;
}

/* Loading Animation */
.calc24-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.calc24-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: spin 0.5s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}