/* Factorial Calculator Styles */
.factorial-calculator-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 2rem;
}

.calculator-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.calculator-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.input-section {
    margin-bottom: 24px;
}

.input-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.factorial-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #ffffff;
    color: #1a1a1a;
    transition: all 0.2s ease;
    outline: none;
    font-weight: 500;
}

.factorial-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

.factorial-input::placeholder {
    color: #999;
    font-weight: 400;
}

.calculate-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.calculate-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.calculate-btn:active {
    transform: translateY(0);
}

.calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    width: 20px;
    height: 20px;
    display: none;
}

.input-hint {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}

.result-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid #f0f0f0;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.result-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.clear-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.clear-btn svg {
    width: 20px;
    height: 20px;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.result-display {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.result-label {
    font-size: 16px;
    font-weight: 600;
    color: #666;
    min-width: 80px;
}

.result-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.result-factorial {
    font-size: 22px;
    font-weight: 700;
    color: #007bff;
    
}

.result-number {
    font-size: 24px;
    font-weight: 700;
    color: #007bff;
    word-break: break-all;
    
}

.steps-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.steps-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 16px 0;
}

.steps-content {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    
    background: #ffffff;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.error-message {
    margin-top: 16px;
    padding: 16px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 12px;
    color: #856404;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.info-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.info-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px 0;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-item {
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-subtitle {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.info-text {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.formula-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.formula {
    
    font-size: 16px;
    color: #1a1a1a;
    display: block;
}

.formula-special {
    
    font-size: 16px;
    color: #007bff;
    font-weight: 600;
    display: block;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-list li {
    font-size: 16px;
    color: #555;
    padding-left: 24px;
    position: relative;
    line-height: 1.6;
}

.info-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #007bff;
    font-weight: 700;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.example-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #007bff;
}

.example-formula {
    
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.example-equals {
    font-size: 16px;
    color: #666;
}

.example-result {
    
    font-size: 16px;
    font-weight: 600;
    color: #007bff;
}

/* Mobile-First Responsive Design */
@media (max-width: 767px) {
    .factorial-calculator-section {
        gap: 20px;
    }

    .calculator-card,
    .info-card {
        padding: 24px 20px;
        border-radius: 12px;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .calculate-btn {
        width: 100%;
        justify-content: center;
    }

    .btn-icon {
        display: block;
    }

    .btn-text {
        display: none;
    }

    .result-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .result-label {
        min-width: auto;
    }

    .result-value,
    .result-factorial,
    .result-number {
        font-size: clamp(16px, 4vw, 20px);
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }

    .info-title {
        font-size: clamp(1.5rem, 5vw, 1.75rem);
    }

    .info-subtitle {
        font-size: clamp(1.125rem, 4vw, 1.25rem);
    }

    .steps-content {
        font-size: 14px;
        padding: 12px;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .calculator-card,
    .info-card {
        padding: 20px 16px;
    }

    .factorial-input {
        font-size: 16px;
        padding: 12px 16px;
    }

    .calculate-btn {
        padding: 12px 20px;
        font-size: 15px;
    }

    .result-title {
        font-size: 20px;
    }

    .formula-box {
        padding: 12px;
    }

    .formula,
    .formula-special {
        font-size: 14px;
    }
}

/* Dark mode support (if applicable) */
@media (prefers-color-scheme: dark) {
    .calculator-card,
    .info-card {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .input-label,
    .result-title,
    .info-title,
    .info-subtitle {
        color: #ffffff;
    }

    .factorial-input {
        background: #2a2a2a;
        border-color: #404040;
        color: #ffffff;
    }

    .factorial-input:focus {
        border-color: #007bff;
    }

    .input-hint,
    .result-label {
        color: #999;
    }

    .result-value {
        color: #ffffff;
    }

    .steps-section,
    .formula-box {
        background: #2a2a2a;
    }

    .steps-content {
        background: #1a1a1a;
        color: #ffffff;
    }

    .info-text,
    .info-list li {
        color: #ccc;
    }

    .example-item {
        background: #2a2a2a;
    }
}
