/* Prime Filter Card - Single Card Design */
.prime-filter-card {
    margin-top: 2rem;
}

.card-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.card-container:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.card-body {
    padding: 2rem;
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    gap: 0.5rem;
    background: transparent;
    padding: 0;
}

.mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.mode-tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    border-radius: 3px 3px 0 0;
    transition: width 0.3s ease;
}

.mode-tab:hover {
    background: rgba(0, 123, 255, 0.08);
    color: #007bff;
}

.mode-tab.active {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.mode-tab.active::before {
    width: 80%;
}

.mode-tab i {
    font-size: 1rem;
}

/* Input Section */
.input-section {
    margin-top: 1.5rem;
}

.mode-content {
    position: relative;
}

.mode-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.mode-panel.active {
    display: block;
}

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

/* Input Fields */
.input-group-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.25rem;
    align-items: end;
    margin-bottom: 1.5rem;
}

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

.input-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    letter-spacing: 0.3px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
    
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
    background: #f8f9ff;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.input-hint {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    font-style: italic;
}

.range-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 1.75rem;
    color: #6c757d;
    font-size: 1.125rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-btn:hover::before {
    width: 300px;
    height: 300px;
}

.action-btn.primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.action-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.action-btn.outline {
    background: transparent;
    border: 2px solid #e9ecef;
    color: #495057;
}

.action-btn.outline:hover {
    border-color: #007bff;
    color: #007bff;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.action-btn i {
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

.action-btn span {
    position: relative;
    z-index: 1;
}

/* Results Section */
.results-section {
    animation: slideDown 0.4s ease;
}

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

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e9ecef 20%, #e9ecef 80%, transparent 100%);
    margin: 2rem 0;
}

.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: 700;
    margin: 0;
    color: #212529;
    letter-spacing: -0.5px;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    background: #f8f9fa;
    padding: 0.25rem;
    border-radius: 10px;
}

.view-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn:hover {
    color: #495057;
    background: rgba(0, 0, 0, 0.05);
}

.view-btn.active {
    background: #fff;
    color: #007bff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

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

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 123, 255, 0.2);
}

.stat-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon.total {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: #fff;
}

.stat-icon.prime {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: #fff;
}

.stat-icon.composite {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
}

.stat-icon.percentage {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: #fff;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Numbers Display */
.numbers-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    min-height: 100px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.number-badge:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.number-badge.prime {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: #fff;
}

.number-badge.composite {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
}

.number-badge.neither {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: #fff;
}

/* Results Actions */
.results-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .prime-filter-card {
        margin-top: 1.5rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .card-header {
        padding: 1rem 1.25rem;
    }

    .mode-tabs {
        gap: 0.25rem;
    }

    .mode-tab {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }

    .mode-tab span {
        display: none;
    }

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

    .range-separator {
        padding-bottom: 0;
        transform: rotate(90deg);
    }

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

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

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

    .view-toggle {
        width: 100%;
    }

    .view-btn {
        flex: 1;
        justify-content: center;
    }

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

    .stat-item {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        padding: 1rem;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.125rem;
    }

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

    .numbers-display {
        max-height: 300px;
        padding: 1rem;
        gap: 0.5rem;
    }

    .number-badge {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .results-actions {
        flex-direction: column;
    }

    .results-actions .action-btn {
        width: 100%;
        justify-content: center;
    }
}

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

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

    .section-divider {
        margin: 1.5rem 0;
    }
}

/* Scrollbar Styling */
.numbers-display::-webkit-scrollbar {
    width: 8px;
}

.numbers-display::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.numbers-display::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #adb5bd 0%, #868e96 100%);
    border-radius: 4px;
}

.numbers-display::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #868e96 0%, #6c757d 100%);
}
