/* CalWhat Calculator Platform - Permutation & Combination Calculator Styles */

/* ===========================
   Action Buttons Grid
   =========================== */
.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* ===========================
   Action Buttons
   =========================== */
.btn-custom,
.btn-custom-outline {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
}

.btn-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-custom-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-custom-outline:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.btn-custom:active,
.btn-custom-outline:active {
    transform: translateY(0);
}

/* ===========================
   Sponsor Button
   =========================== */
.btn-sponsor {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
}

.btn-sponsor:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

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

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #48bb78;
    border-radius: 12px;
    font-family: 'Roboto Mono', monospace;
    font-size: 1.1rem;
    background: #f0fff4;
    transition: all 0.3s ease;
}

/* ===========================
   Input Error Styles
   =========================== */
.input-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.input-error {
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

/* ===========================
   Results Grid
   =========================== */
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-left: 4px solid #667eea;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.result-label {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.result-description {
    font-size: 0.85rem;
    color: #a0aec0;
}

/* ===========================
   Step-by-step Container
   =========================== */
.steps-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 8px;
}

.steps-container h4 {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
}

.step-item {
    background: white;
    border-left: 4px solid #48bb78;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.step-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.step-formula {
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    color: #667eea;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 4px;
}

.step-calculation {
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.step-result {
    font-size: 1rem;
    font-weight: 600;
    color: #48bb78;
}

/* ===========================
   Pascal's Triangle
   =========================== */
.pascals-triangle {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    overflow-x: auto;
}

.triangle-row {
    display: flex;
    justify-content: center;
    margin: 0.25rem 0;
}

.triangle-cell {
    display: inline-block;
    min-width: 40px;
    padding: 0.4rem 0.6rem;
    margin: 0 0.2rem;
    text-align: center;
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4c51bf;
    transition: all 0.3s ease;
}

.triangle-cell:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #c7d2fe 0%, #ddd6fe 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.triangle-cell.highlight {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    font-weight: 700;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.triangle-note {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 1rem;
    font-style: italic;
}

/* ===========================
   Chart Container
   =========================== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ===========================
   Formula Display
   =========================== */
.formula-display {
    font-size: 1.25rem;
    text-align: center;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

.fraction {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    text-align: center;
}

.numerator {
    border-bottom: 2px solid #333;
    padding: 0 0.5rem;
}

.denominator {
    padding: 0 0.5rem;
}

.formula-display sup {
    font-size: 0.7em;
    vertical-align: super;
}

.formula-display sub {
    font-size: 0.7em;
    vertical-align: sub;
}

/* ===========================
   Responsive Adjustments
   =========================== */
@media (max-width: 576px) {
    .action-buttons-grid {
        grid-template-columns: 1fr;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .triangle-cell {
        min-width: 32px;
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
        margin: 0 0.1rem;
    }

    .chart-container {
        height: 250px;
    }

    .steps-container {
        padding: 1rem;
    }

    .step-formula {
        font-size: 0.95rem;
    }
}

@media (min-width: 577px) and (max-width: 991px) {
    .chart-container {
        height: 280px;
    }
}

@media (min-width: 992px) {
    .results-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* ===========================
   Alert Styles
   =========================== */
.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(249, 115, 22, 0.1) 100%);
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    border-radius: 8px;
    color: #92400e;
}

/* ===========================
   Form Check Styles
   =========================== */
.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-label {
    font-size: 0.95rem;
    color: #4a5568;
    cursor: pointer;
}

/* ===========================
   SEO Section Styles
   =========================== */
.seo-section {
    color: #4a5568;
    line-height: 1.8;
}

.seo-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2d3748;
}

.seo-section h3 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem;
    color: #2d3748;
}

.seo-section h4 {
    font-size: 1.05rem;
    margin: 1rem 0 0.5rem;
    color: #2d3748;
}

.seo-section p {
    margin-bottom: 1rem;
}

.seo-section ul,
.seo-section ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.seo-section li {
    margin-bottom: 0.5rem;
}