/* ============================================
   Sharing Component Styles
   HomeOS Platform
   ============================================ */

/* Sharing Panel */
.sharing-panel {
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 12px;
}

.dark .sharing-panel {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(71, 85, 105, 0.5);
}

/* Search */
.sharing-search-container {
    position: relative;
    margin-bottom: 12px;
}

.sharing-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    transition: border-color 0.2s;
}

.sharing-search-box:focus-within {
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.dark .sharing-search-box {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(71, 85, 105, 0.5);
}

.sharing-search-box i {
    color: #94a3b8;
    font-size: 13px;
}

.sharing-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary, #1e293b);
}

.dark .sharing-search-input {
    color: #e2e8f0;
}

.sharing-search-input::placeholder {
    color: #94a3b8;
}

/* Search Results Dropdown */
.sharing-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

.dark .sharing-search-results {
    background: #1e293b;
    border-color: rgba(71, 85, 105, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sharing-search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.sharing-search-result-item:hover {
    background: rgba(59, 130, 246, 0.05);
}

.dark .sharing-search-result-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.sharing-search-no-result {
    padding: 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

/* User Avatar */
.sharing-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

/* User Info */
.sharing-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sharing-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .sharing-user-name {
    color: #e2e8f0;
}

.sharing-user-detail {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Buttons */
.sharing-add-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #10b981;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.15s;
    flex-shrink: 0;
}

.sharing-add-btn:hover {
    background: #059669;
}

.sharing-remove-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.sharing-remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Shared Users List */
.shared-users-list {
    max-height: 200px;
    overflow-y: auto;
}

.shared-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color, #f1f5f9);
}

.dark .shared-user-item {
    border-color: rgba(71, 85, 105, 0.3);
}

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

.sharing-empty-text {
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
    padding: 12px 0;
    margin: 0;
}

.sharing-empty-text i {
    margin-right: 4px;
}

/* Visibility Badge in List View */
.visibility-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.visibility-badge.private {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.dark .visibility-badge.private {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.visibility-badge.protected {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.dark .visibility-badge.protected {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.visibility-badge.public {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.dark .visibility-badge.public {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}
