/**
 * Groups Component Styles
 * 
 * Shared styles for the groups dropdown, modals, and related UI components.
 * Used by Character Studio, Gems, Trivia, and other games.
 */

/* ============================================================
   GROUPS DROPDOWN
   ============================================================ */

.groups-dropdown {
    position: relative;
}

.groups-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px;
    border: 2px solid #3d3d5c;
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.groups-dropdown-toggle:hover {
    border-color: #555;
}

.groups-dropdown.open .groups-dropdown-toggle {
    border-color: #feca57;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.groups-selected-text {
    color: #888;
}

.groups-selected-text.has-selection {
    color: #fff;
}

.dropdown-arrow {
    color: #888;
    font-size: 0.8rem;
    transition: transform 0.15s ease;
}

.groups-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.groups-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 2px solid #feca57;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.groups-dropdown.open .groups-dropdown-menu {
    display: block;
}

.groups-list {
    padding: 8px 0;
}

/* ============================================================
   GROUP CHECKBOX ITEMS
   ============================================================ */

.group-checkbox-item {
    display: flex !important;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s ease;
}

.group-checkbox-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.group-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #9b59b6;
    flex-shrink: 0;
    margin: 0;
}

.group-checkbox-item .group-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.group-checkbox-item .group-name {
    flex: 1;
    color: #fff;
    text-wrap-mode: nowrap;
    font-size: small;
}

.group-checkbox-item .group-count {
    color: #666;
    font-size: 0.85rem;
}

/* ============================================================
   GROUP ACTION BUTTONS (Edit/Delete)
   ============================================================ */

.group-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.group-action-btn {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s ease;
    font-size: 0.9rem;
}

.group-action-btn:hover {
    opacity: 1;
}

.group-action-btn.edit-btn:hover {
    color: #3498db;
}

.group-action-btn.delete-btn:hover {
    color: #e74c3c;
}

/* ============================================================
   DROPDOWN FOOTER
   ============================================================ */

.groups-dropdown-footer {
    border-top: 1px solid #3d3d5c;
    padding: 8px;
}

.create-group-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px dashed #666;
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.create-group-btn:hover {
    border-color: #feca57;
    color: #feca57;
    background: rgba(254, 202, 87, 0.1);
}

.no-groups-message {
    padding: 12px;
    color: #666;
    text-align: center;
    font-size: 0.9rem;
}

/* ============================================================
   GO BUTTON (for games filter)
   ============================================================ */

.groups-dropdown-go {
    padding: 8px;
    border-bottom: 1px solid #3d3d5c;
}

.groups-go-btn {
    width: 100%;
    padding: 8px 16px;
    background: #9b59b6;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.15s ease;
}

.groups-go-btn:hover {
    background: #8e44ad;
}

/* ============================================================
   GROUP MODALS
   ============================================================ */

.group-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.group-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.group-modal {
    background: #1a1a2e;
    border: 2px solid #feca57;
    border-radius: 12px;
    padding: 24px;
    max-width: 380px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.group-modal h3 {
    margin: 0 0 20px 0;
    color: #f1c40f;
    font-size: 1.3rem;
}

.group-modal .form-group {
    margin-bottom: 16px;
}

.group-modal label {
    display: block;
    color: #ccc;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.group-modal input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #3d3d5c;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
    box-sizing: border-box;
}

.group-modal input[type="text"]:focus {
    outline: none;
    border-color: #feca57;
}

.group-modal input[type="text"]::placeholder {
    color: #666;
}

/* ============================================================
   COLOR PICKER
   ============================================================ */

.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    font-size: 0;
    transition: all 0.15s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ============================================================
   MODAL BUTTONS
   ============================================================ */

.group-modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.group-modal-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.group-modal-btn.secondary {
    background: #3d3d5c;
    color: #fff;
}

.group-modal-btn.secondary:hover {
    background: #4d4d6c;
}

.group-modal-btn.primary {
    background: #9b59b6;
    color: #fff;
}

.group-modal-btn.primary:hover {
    background: #8e44ad;
}

.group-modal-btn.danger {
    background: #c0392b;
    color: #fff;
}

.group-modal-btn.danger:hover {
    background: #e74c3c;
}

/* ============================================================
   DELETE CONFIRMATION
   ============================================================ */

.group-modal p {
    color: #ccc;
    margin-bottom: 16px;
    line-height: 1.5;
}

.group-modal p.warning {
    color: #888;
    font-size: 0.9rem;
}

/* ============================================================
   PANEL GROUPS DISPLAY (for header area)
   ============================================================ */

.panel-groups {
    color: #888;
    font-size: 0.8rem;
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.panel-groups:empty {
    display: none;
}

.panel-groups .group-label {
    color: #9b59b6;
    font-weight: bold;
}

.panel-groups .group-tag {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 4px;
    background: rgba(155, 89, 182, 0.2);
    border-radius: 4px;
    color: #9b59b6;
    font-size: 0.75rem;
}

