/**
 * Full Screen Calculator CSS
 * CalcTechLab.com
 * Consistent with CalcTechLab theme
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.calculator-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.calculator-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.calculator-header p {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Calculator Card */
.calculator-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.calculator-card.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    border-radius: 0;
    z-index: 9999;
}

/* Calculator Controls */
.calculator-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
}

.calculator-mode {
    display: flex;
    gap: 10px;
}

.mode-btn {
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.mode-btn.active {
    background: white;
    color: #2563eb;
    border-color: white;
}

.calculator-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Display */
.calculator-display {
    background: #1e293b;
    padding: 30px;
    color: white;
}

.display-history {
    min-height: 30px;
    font-size: 1rem;
    color: #94a3b8;
    text-align: right;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.display-current {
    font-size: 3rem;
    font-weight: 300;
    text-align: right;
    min-height: 60px;
    word-wrap: break-word;
    color: white;
}

/* Memory Display */
.memory-display {
    padding: 10px 30px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    display: none;
}

.memory-display.active {
    display: block;
}

.memory-value {
    font-size: 0.9rem;
    color: #64748b;
}

.memory-value span {
    font-weight: 600;
    color: #2563eb;
}

/* Calculator Body */
.calculator-body {
    padding: 20px;
    background: #f8fafc;
}

/* Button Grid */
.button-grid {
    display: grid;
    gap: 10px;
}

.button-grid.basic {
    grid-template-columns: repeat(4, 1fr);
}

.button-grid.scientific {
    grid-template-columns: repeat(5, 1fr);
}

/* Buttons */
.calc-btn {
    padding: 20px;
    font-size: 1.3rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.calc-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Button Types */
.calc-btn.number {
    background: white;
    color: #1e293b;
}

.calc-btn.operator {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.calc-btn.function {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    font-size: 1rem;
}

.calc-btn.equals {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    grid-column: span 2;
}

.calc-btn.clear {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.calc-btn.zero {
    grid-column: span 2;
}

/* History Panel */
.history-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 10000;
    overflow-y: auto;
}

.history-panel.active {
    right: 0;
}

.history-header {
    padding: 20px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header h3 {
    font-size: 1.3rem;
}

.close-history {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
}

.history-content {
    padding: 20px;
}

.history-item {
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #e2e8f0;
    transform: translateX(-5px);
}

.history-expression {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 5px;
}

.history-result {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2563eb;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.clear-history-btn {
    width: 100%;
    padding: 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
}

.clear-history-btn:hover {
    background: #dc2626;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid #2563eb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-box h3 {
    color: #1e40af;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.info-box p {
    color: #1e40af;
    line-height: 1.6;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feature-card h3 {
    color: #2563eb;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.feature-card p {
    color: #64748b;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-header h1 {
        font-size: 1.8rem;
    }
    
    .calculator-header p {
        font-size: 1rem;
    }
    
    .display-current {
        font-size: 2rem;
    }
    
    .calc-btn {
        padding: 15px;
        font-size: 1.1rem;
    }
    
    .calc-btn.function {
        font-size: 0.85rem;
    }
    
    .history-panel {
        width: 100%;
        right: -100%;
    }
    
    .calculator-mode {
        flex-direction: column;
        gap: 5px;
    }
    
    .mode-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .calculator-header {
        margin-bottom: 15px;
    }
    
    .calculator-header h1 {
        font-size: 1.5rem;
    }
    
    .display-current {
        font-size: 1.8rem;
    }
    
    .calc-btn {
        padding: 12px;
        font-size: 1rem;
    }
    
    .button-grid {
        gap: 8px;
    }
}

/* Fullscreen Mode Adjustments */
.calculator-card.fullscreen .calculator-body {
    height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.calculator-card.fullscreen .button-grid {
    max-width: 600px;
    margin: 0 auto;
}

.calculator-card.fullscreen .calc-btn {
    padding: 25px;
    font-size: 1.5rem;
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculator-card {
    animation: fadeIn 0.5s ease;
}

/* Keyboard Hint */
.keyboard-hint {
    text-align: center;
    padding: 15px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.9rem;
    border-top: 1px solid #e2e8f0;
}

.keyboard-hint span {
    font-weight: 600;
    color: #2563eb;
}