/* Binomial Generator Styles */
.binomial-generator {
    margin-top: 2rem;
}

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

.generator-header {
    margin-bottom: 2rem;
}

.generator-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #1a1a1a;
}

.generator-description {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-field {
    display: flex;
    flex-direction: column;
}

.input-label {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.label-text {
    font-weight: 500;
}

.label-hint {
    font-weight: 400;
    color: #888;
    font-size: 0.85rem;
}

.input-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #fafafa;
}

.input-control:focus {
    outline: none;
    border-color: #4a90e2;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.input-control:hover {
    border-color: #ccc;
}

.input-help {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.25rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

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

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.btn-icon {
    font-size: 1.1rem;
}

/* Results Section */
.results-container {
    margin-top: 2rem;
    animation: fadeIn 0.3s ease;
}

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

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: #1a1a1a;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.format-select {
    padding: 0.5rem 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.format-select:focus {
    outline: none;
    border-color: #4a90e2;
    background: #fff;
}

.btn-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.btn-icon-only:hover {
    background: #e8e8e8;
    border-color: #ccc;
    transform: translateY(-1px);
}

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

.numbers-display-wrapper {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.numbers-display {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4a90e2;
}

/* Comparison Card */
.comparison-card {
    background: #f0f7ff;
    border: 1px solid #b3d9ff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.comparison-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #1a1a1a;
}

.comparison-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.comparison-content > div {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
}

.comparison-content strong {
    color: #333;
    font-weight: 600;
}

/* Frequency Section */
.frequency-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #1a1a1a;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.frequency-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.9rem;
}

.frequency-table thead {
    background: #f8f9fa;
}

.frequency-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.frequency-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}

.frequency-table tbody tr:hover {
    background: #f8f9fa;
}

.frequency-table tbody tr:last-child td {
    border-bottom: none;
}

/* Histogram Section */
.histogram-section {
    margin-bottom: 1rem;
}

.histogram-container {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 2px;
    height: 200px;
    padding: 1rem;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 0.5rem;
    position: relative;
}

.histogram-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #333;
}

.histogram-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    top: 0;
    width: 2px;
    background: #333;
}

.histogram-bar {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    background: linear-gradient(180deg, #4a90e2 0%, #357abd 100%);
    min-width: 20px;
    margin: 0 1px;
    border-radius: 4px 4px 0 0;
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
    position: relative;
}

.histogram-bar:hover {
    opacity: 0.8;
}

.histogram-bar::after {
    content: attr(data-value);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #666;
    white-space: nowrap;
}

.histogram-note {
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .generator-card {
        padding: 1.5rem;
    }

    .input-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .results-actions {
        flex-wrap: wrap;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .comparison-content {
        grid-template-columns: 1fr;
    }

    .histogram-container {
        height: 150px;
    }

    .numbers-display-wrapper {
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    .generator-card {
        padding: 1rem;
    }

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

    .stat-value {
        font-size: 1.25rem;
    }
}

/* Scrollbar Styling */
.numbers-display-wrapper::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar,
.histogram-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.numbers-display-wrapper::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track,
.histogram-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.numbers-display-wrapper::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb,
.histogram-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.numbers-display-wrapper::-webkit-scrollbar-thumb:hover,
.table-wrapper::-webkit-scrollbar-thumb:hover,
.histogram-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
