/* Calculator CSS - Styling for calculator.php */

/* Calculator Content Container */
.calculator-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.page-title-section .section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title-section .section-subtitle {
    color: #6b7280;
    font-size: 1rem;
}

.page-actions {
    display: flex;
    gap: 1rem;
}

/* Calculator Container */
.calculator-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

/* Calculator Widget */
.calculator-widget {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 400px;
}

/* Calculator Display */
.calculator-display {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: right;
    border: 2px solid #e9ecef;
}

.history-display {
    color: #6c757d;
    font-size: 1rem;
    min-height: 1.5rem;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
}

.current-display {
    color: #212529;
    font-size: 2.5rem;
    font-weight: bold;
    min-height: 3rem;
    font-family: 'Courier New', monospace;
}

/* Calculator Buttons */
.calculator-buttons {
    display: grid;
    gap: 0.75rem;
}

.button-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.calc-btn {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 0.75rem;
    padding: 1.25rem 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
    min-height: 3.5rem;
}

.calc-btn:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.calc-btn:active {
    transform: translateY(0);
}

/* Button Types */
.calc-btn.function {
    background: #e9ecef;
    color: #495057;
}

.calc-btn.operator {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.calc-btn.equals {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.calc-btn.number {
    background: white;
    color: #495057;
}

/* Calculator History */
.calculator-history {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    height: fit-content;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.history-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-history-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clear-history-btn:hover {
    background: #c82333;
}

/* History List */
.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #495057;
    transition: background-color 0.2s ease;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background-color: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .calculator-widget {
        max-width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .page-actions {
        justify-content: center;
    }
    
    .button-row {
        gap: 0.5rem;
    }
    
    .calc-btn {
        padding: 1rem 0.25rem;
        font-size: 1rem;
        min-height: 3rem;
    }
}

/* Button Focus States */
.calc-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Animation for button clicks */
.calc-btn:active {
    transform: scale(0.95);
}

/* Custom scrollbar for history */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
