/* 🎨 Unified Channels System Styles */
/* Стилі для об'єднаної системи управління каналами */

/* Action Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.2);
}

/* Tab Navigation (legacy - hidden) */
.tabs-container {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 0.5rem;
}

.tab-button {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: rgba(226, 232, 240, 0.95);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-button:hover {
    background: rgba(102, 126, 234, 0.15);
    color: #e5e7eb;
    border-color: rgba(102, 126, 234, 0.3);
}

.tab-button.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tab-button i {
    font-size: 1.2rem;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Channel Cards Grid */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.channel-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(51, 65, 85, 0.6));
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}


.channel-card:hover {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    transform: translateY(-4px);
}


.channel-header {
    display: flex;
    align-items: start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.channel-avatar {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.channel-info {
    flex: 1;
    min-width: 0;
}

.channel-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e5e7eb;
    margin: 0 0 0.25rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-id {
    font-size: 0.75rem;
    color: rgba(226, 232, 240, 0.5);
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.channel-status.active {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.channel-status.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.channel-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(226, 232, 240, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.channel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.action-button {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.1);
    color: #e5e7eb;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-button:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.action-button.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
}

.action-button.primary:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Configuration Form */
.config-form {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: #667eea;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    color: #e5e7eb;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.form-group .help-text {
    display: block;
    font-size: 0.8125rem;
    color: rgba(226, 232, 240, 0.6);
    margin-top: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.form-control::placeholder {
    color: rgba(226, 232, 240, 0.4);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 24px;
    background: rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* Select Dropdown */
select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e5e7eb' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    appearance: none;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
}

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

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

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

.btn-secondary {
    background: rgba(102, 126, 234, 0.1);
    color: #e5e7eb;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: rgba(226, 232, 240, 0.6);
}

.loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(226, 232, 240, 0.6);
}

.empty-state i {
    font-size: 4rem;
    color: rgba(102, 126, 234, 0.3);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #e5e7eb;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .channels-grid {
        grid-template-columns: 1fr;
    }

    .tabs-container {
        flex-direction: column;
    }

    .tab-button {
        padding: 0.875rem 1rem;
    }

    .config-form {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

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

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

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

@media (max-width: 480px) {
    .channel-stats {
        grid-template-columns: 1fr;
    }
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(148, 163, 184, 0.3);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #10b981;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Token Status Indicator */
.token-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 8px currentColor;
}

/* Channel Controls */
.channel-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Update channel stats grid */
.channel-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.25rem;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(226, 232, 240, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

}

/* Subtle Active vs Inactive Channels */
    color: rgba(148, 163, 184, 0.8);
}

/* Enhanced active/inactive channel differentiation */
.channel-card.active-channel {
    background: rgba(16, 185, 129, 0.12);
    border-left: 4px solid #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.channel-card.inactive-channel {
    opacity: 0.5;
    background: rgba(107, 114, 128, 0.06);
    border-left: 4px solid #6b7280;
    filter: grayscale(0.3);
}

.channel-card.inactive-channel:hover {
    opacity: 0.7;
}

.channel-card.inactive-channel .channel-name {
    color: rgba(226, 232, 240, 0.6);
}

.channel-card.inactive-channel .channel-id,
.channel-card.inactive-channel .stat-label {
    color: rgba(148, 163, 184, 0.6);
}

.channel-card.inactive-channel .stat-value {
    color: rgba(148, 163, 184, 0.7);
}
