/* Range Counter Interface Styles */
.range-counter-interface {
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-card {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2.5rem;
    align-items: start;
}

.card-column {
    display: flex;
    flex-direction: column;
}

.input-column {
    min-width: 0;
}

.results-column {
    min-width: 0;
}

.card-divider {
    width: 1px;
    background: linear-gradient(to bottom, transparent, #e1e8ed 10%, #e1e8ed 90%, transparent);
    align-self: stretch;
}

.input-group {
    margin-bottom: 1.5rem;
}

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

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

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

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

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

.range-controls {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.range-input-group {
    flex: 1;
    min-width: 120px;
}

.range-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.range-input-field {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    background: #ffffff;
}

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

.range-separator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    min-width: 60px;
    justify-content: center;
}

.separator-line {
    flex: 1;
    height: 2px;
    background: #dee2e6;
}

.separator-text {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.endpoint-toggle {
    margin-bottom: 1.5rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.toggle-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: #dee2e6;
    border-radius: 26px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-checkbox:checked + .toggle-slider {
    background: #007bff;
}

.toggle-checkbox:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.toggle-text {
    font-size: 0.9375rem;
    color: #495057;
    font-weight: 500;
}

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

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

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

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

.btn-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.btn-secondary-action {
    padding: 0.875rem 1.5rem;
    background: #ffffff;
    color: #495057;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary-action:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* Results Column */
.results-column {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.results-column.active {
    opacity: 1;
    pointer-events: auto;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

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

.range-indicator {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #ffffff;
    border-radius: 20px;
    font-size: 0.9375rem;
    font-weight: 600;
}

.count-display {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 2px solid #e3f2fd;
}

.count-value {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.count-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.count-percentage {
    font-size: 1rem;
    color: #6c757d;
}

/* Categorization Grid */
.categorization-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-card {
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.below-card {
    border-color: #ffc107;
}

.below-card:hover {
    border-color: #ff9800;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.15);
}

.in-range-card {
    border-color: #28a745;
}

.in-range-card:hover {
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.above-card {
    border-color: #dc3545;
}

.above-card:hover {
    border-color: #dc3545;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.category-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
    flex-shrink: 0;
}

.below-card .category-icon {
    color: #ff9800;
}

.in-range-card .category-icon {
    color: #28a745;
}

.above-card .category-icon {
    color: #dc3545;
}

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

.number-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}

.number-tag {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
    transition: transform 0.2s ease;
}

.number-tag:hover {
    transform: scale(1.05);
}

.tag-below {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.tag-in-range {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

.tag-above {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
}

.empty-state {
    color: #adb5bd;
    font-style: italic;
    font-size: 0.875rem;
}

.category-count {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    text-align: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.stat-item:hover {
    border-color: #007bff;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.1);
}

.stat-label {
    font-size: 0.8125rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

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

/* Copy Actions */
.copy-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-copy {
    flex: 1;
    min-width: 160px;
    padding: 0.875rem 1.5rem;
    background: #ffffff;
    color: #495057;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.btn-copy svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .main-card {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 2rem;
    }

    .card-divider {
        display: none;
    }

    .results-column {
        margin-top: 2rem;
        padding-top: 2rem;
        border-top: 1px solid #e1e8ed;
    }
}

@media (max-width: 768px) {
    .range-counter-interface {
        padding: 0 0.5rem;
    }

    .main-card {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .range-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .range-separator {
        width: 100%;
        padding: 0.5rem 0;
    }

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

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

    .count-value {
        font-size: 3rem;
    }

    .action-buttons,
    .copy-actions {
        flex-direction: column;
    }

    .btn-primary-action,
    .btn-secondary-action,
    .btn-copy {
        width: 100%;
    }
}

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

    .count-value {
        font-size: 2.5rem;
    }

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