/* Mode Calculator Styles */
.mode-calculator {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

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

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

.input-section {
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.input-label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.label-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
}

.label-hint {
    font-size: 0.875rem;
    color: #6c757d;
}

.number-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 1rem;
    
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #1a1a1a;
}

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

.number-input::placeholder {
    color: #adb5bd;
}

.input-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn-calculate {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

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

.btn-clear {
    padding: 0.875rem 1.75rem;
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

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

/* Results Section */
.results-section {
    padding: 2rem;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    animation: fadeIn 0.4s ease;
}

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

.results-header {
    margin-bottom: 1.5rem;
}

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

.mode-display-card {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px solid #ffb74d;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.mode-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e65100;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.mode-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #e65100;
    margin-bottom: 1rem;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.mode-number-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #ff9800;
    color: #ffffff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.mode-no-result {
    color: #6c757d;
    font-style: italic;
    font-size: 1.125rem;
}

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

.stat-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
}

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

.stat-label {
    font-size: 0.8125rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

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

.frequency-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.frequency-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background: #ffffff;
}

.frequency-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f3f5;
    transition: all 0.2s ease;
}

.frequency-item:last-child {
    border-bottom: none;
}

.frequency-item:hover {
    background: #f8f9fa;
}

.frequency-item.mode-item {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    font-weight: 600;
}

.frequency-number {
    font-size: 1rem;
    color: #1a1a1a;
    font-weight: 500;
}

.frequency-count {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: #495057;
}

.frequency-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: #ff9800;
    color: #ffffff;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.btn-action {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 140px;
}

.btn-copy {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-copy-secondary {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.btn-copy-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .input-section {
        padding: 1.5rem;
    }

    .results-section {
        padding: 1.5rem;
    }

    .mode-value {
        font-size: 2rem;
    }

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

    .stat-card {
        padding: 1rem;
    }

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

    .frequency-list {
        max-height: 250px;
    }

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

    .btn-action {
        width: 100%;
    }

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

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

@media (max-width: 480px) {
    .mode-display-card {
        padding: 1.5rem;
    }

    .mode-value {
        font-size: 1.75rem;
    }

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

/* Scrollbar Styling */
.frequency-list::-webkit-scrollbar {
    width: 8px;
}

.frequency-list::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.frequency-list::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

.frequency-list::-webkit-scrollbar-thumb:hover {
    background: #868e96;
}
