/* Calculator Tool Styles */
.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-description {
    font-size: 1.1rem;
    color: #666;
    margin-top: 0.5rem;
}

.tool-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.calculator-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.calculator-modes {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.mode-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.calculator-display {
    background: #f8fafc;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    min-height: 80px;
}

.expression-display {
    font-size: 0.9rem;
    color: #6b7280;
    min-height: 20px;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

#mainDisplay {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 2rem;
    font-weight: 600;
    text-align: right;
    color: #1f2937;
    outline: none;
}

.calculator-buttons {
    margin-bottom: 1rem;
}

.button-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.scientific-layout .button-row {
    grid-template-columns: repeat(6, 1fr);
}

.calc-btn {
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.calc-btn:active {
    transform: translateY(0);
}

.number-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.number-btn:hover {
    background: #e5e7eb;
}

.operator-btn {
    background: #3b82f6;
    color: white;
}

.operator-btn:hover {
    background: #2563eb;
}

.function-btn {
    background: #6b7280;
    color: white;
}

.function-btn:hover {
    background: #4b5563;
}

.scientific-btn {
    background: #8b5cf6;
    color: white;
    font-size: 0.9rem;
}

.scientific-btn:hover {
    background: #7c3aed;
}

.equals-btn {
    background: #10b981;
    color: white;
}

.equals-btn:hover {
    background: #059669;
}

.zero-btn {
    grid-column: span 2;
}

.calculator-memory {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.memory-btn {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.memory-btn:hover {
    background: #e5e7eb;
}

.memory-btn.active {
    background: #fef3c7;
    border-color: #f59e0b;
}

.history-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.history-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background: #f3f4f6;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.history-item:hover {
    background: #f8fafc;
}

.history-item:last-child {
    border-bottom: none;
}

.history-expression {
    font-family: monospace;
    color: #6b7280;
}

.history-result {
    font-weight: 600;
    color: #1f2937;
}

.no-history {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

.tool-info {
    grid-column: 1 / -1;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.info-section h3 {
    margin-bottom: 1rem;
    color: #1f2937;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-item {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
}

.feature-item h4 {
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.feature-item p {
    color: #6b7280;
    margin: 0;
}

.info-section h4 {
    margin: 1.5rem 0 0.5rem 0;
    color: #374151;
}

.info-section ul {
    margin-left: 1.5rem;
}

.info-section li {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .tool-content {
        grid-template-columns: 1fr;
    }
    
    .calculator-modes {
        flex-direction: column;
    }
    
    .history-controls {
        flex-direction: column;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .calc-btn {
        padding: 0.8rem;
        font-size: 1rem;
    }
    
    #mainDisplay {
        font-size: 1.5rem;
    }
}
