/* ===== BULK OPERATIONS & ENHANCED HEADER STYLES ===== */

/* Enhanced Header Container */
.scripts-canvas-header-enhanced {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.05) 0%, rgba(0, 204, 255, 0.05) 100%);
    border: 1px solid rgba(0, 102, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

/* Header Row 1 */
.header-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-title-section h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.server-count-badge {
    background: rgba(0, 102, 255, 0.15);
    color: var(--primary-color);
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(0, 102, 255, 0.3);
}

/* Server Status Badges */
.server-status-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.server-status-badge i.fa-circle {
    font-size: 0.5rem;
}

.server-status-online {
    background: rgba(0, 255, 102, 0.15);
    color: #00ff66;
    border: 1px solid rgba(0, 255, 102, 0.3);
}

.iran-ping-badge {
    background: rgba(255, 165, 0, 0.15);
    color: #ffa500;
    border: 1px solid rgba(255, 165, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.iran-ping-badge:hover {
    background: rgba(255, 165, 0, 0.25);
    transform: translateY(-1px);
}

.iran-ping-badge.ping-success {
    background: rgba(0, 255, 102, 0.15);
    color: #00ff66;
    border: 1px solid rgba(0, 255, 102, 0.3);
}

.iran-ping-badge.ping-partial {
    background: rgba(255, 165, 0, 0.15);
    color: #ffa500;
    border: 1px solid rgba(255, 165, 0, 0.3);
}

.iran-ping-badge.ping-fail {
    background: rgba(255, 51, 102, 0.15);
    color: #ff3366;
    border: 1px solid rgba(255, 51, 102, 0.3);
}

/* Search Box */
.header-actions-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-box-wrapper {
    position: relative;
    width: 300px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.875rem;
    pointer-events: none;
}

.server-search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.server-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.server-search-input::placeholder {
    color: var(--text-secondary);
}

/* Header Row 2 */
.header-row-2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.account-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inline-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.inline-select {
    min-width: 250px;
    padding: 0.625rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.inline-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.inline-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.header-controls-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.divider-vertical {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
}

/* Select All Wrapper */
.select-all-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 38px;
    height: 38px;
}

.select-all-wrapper:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.bulk-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
    /* Override global checkbox styles */
    position: relative !important;
    opacity: 1 !important;
    z-index: 1 !important;
}

.checkbox-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    line-height: 1;
}

.collapse-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    line-height: 1;
}

.select-all-wrapper i {
    font-size: 0.875rem;
    line-height: 1;
}

/* Bulk Actions Toolbar */
.bulk-actions-toolbar {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.15) 0%, rgba(0, 204, 102, 0.15) 100%);
    border: 1px solid rgba(0, 102, 255, 0.3);
    border-radius: 10px;
    display: none;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 102, 255, 0.2);
    animation: slideDown 0.3s ease-out;
}

.bulk-actions-toolbar.active {
    display: flex;
}

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

.bulk-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.bulk-toolbar-left i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.selected-count {
    font-size: 0.9375rem;
    font-weight: 600;
}

.bulk-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.bulk-action-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}

.bulk-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

/* Server Card Checkbox */
.server-checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    margin-right: 0.25rem;
    flex-shrink: 0;
}

.server-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    transition: transform 0.2s;
    /* Override global checkbox styles */
    position: relative !important;
    opacity: 1 !important;
    z-index: 1 !important;
}

.server-checkbox:hover {
    transform: scale(1.1);
}

/* Server Card Selected State */
.script-server-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.1) 0%, rgba(0, 204, 102, 0.1) 100%);
    box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.2), 0 8px 24px rgba(0, 102, 255, 0.15);
    transform: translateY(-2px);
}

.script-server-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.script-server-card.selected .script-server-card-header {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.15) 0%, rgba(0, 204, 102, 0.15) 100%);
    border-bottom: 2px solid var(--primary-color);
}

.script-server-card.selected .script-server-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Selection Animation */
@keyframes selectPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 102, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 102, 255, 0);
    }
}

.script-server-card.selected {
    animation: selectPulse 0.6s ease-out;
}

/* Bulk Script Picker Modal */
.bulk-script-picker {
    padding: 1rem;
}

.bulk-info {
    background: rgba(0, 102, 255, 0.1);
    border: 1px solid rgba(0, 102, 255, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
    text-align: center;
}

.script-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

.script-picker-item {
    padding: 1.25rem;
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

.script-picker-item:hover {
    border-color: var(--primary-color);
    background: rgba(0, 102, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2);
}

.script-picker-item i {
    font-size: 2rem;
}

.script-picker-name {
    font-weight: 600;
    color: var(--text-primary);
}

.script-picker-category {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-row-1 {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .search-box-wrapper {
        width: 100%;
    }

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

    .bulk-toolbar-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .scripts-canvas-header-enhanced {
        padding: 1rem;
    }

    .bulk-actions-toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .bulk-toolbar-actions {
        justify-content: stretch;
    }

    .bulk-action-btn {
        flex: 1;
    }
}
