/* css/3-components.css */

/* --- Base Icon Circles --- */
.account-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #ddd;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
    background-size: 80%;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid #ccc;
    background-size: cover;
}

/* --- Buttons --- */
.btn-add {
    background: white;
    border: 2px solid #555;
    color: #555;
    padding: 10px 24px; 
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-add:hover {
    background: #555;
    color: white;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
}

.btn-secondary {
    flex: 1;
    background: white;
    border: 2px solid #ddd;
    color: #666;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
}

.btn-delete {
    background: #f44336;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-delete:hover {
    background: #da190b;
}

.btn-small {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #5567d8;
    transform: translateY(-1px);
}

.btn-small.edit {
    background: #4CAF50;
}
.btn-small.edit:hover {
    background: #45a049;
}
.btn-small.delete {
    background: #f44336;
}
.btn-small.delete:hover {
    background: #da190b;
}
.btn-small.accept {
    background: #4CAF50;
}
.btn-small.accept:hover {
    background: #45a049;
}
.btn-small.decline {
    background: #9e9e9e;
}
.btn-small.decline:hover {
    background: #888888;
}
.btn-small.remove {
    background: #f44336;
}
.btn-small.remove:hover {
    background: #da190b;
}
.btn-small.view {
    background: #2196F3;
}
.btn-small.view:hover {
    background: #1a78c2;
}

.btn-clear-focus {
    background: #ffe8b3;
    border: 2px solid #ffd699;
    color: #333;
    padding: 8px 16px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.btn-clear-focus:hover {
    background: #ffd699;
    transform: scale(1.05);
}

#focusModeDisplay {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: center;
}

.focus-mode-header {
    background: #f5f5f5 !important;
    border-bottom: 1px solid #e0e0e0 !important;
    padding: 12px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 15px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.btn-clear-focus-small {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.zoom-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.4em;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.zoom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* --- Forms & Inputs --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1em;
}

/* Time picker dropdowns */
.form-group > div[style*="display: flex"] > select {
    border: 2px solid #ddd !important;
    border-radius: 10px;
    padding: 12px;
    font-size: 1em;
    background-color: white;
    box-sizing: border-box;
}

/* Date/Time picker inputs */
.form-group > div[style*="display: flex"] > input[type="text"] {
    border: 2px solid #ddd !important;
    border-radius: 10px;
    padding: 12px;
    font-size: 1em;
    background-color: white;
    box-sizing: border-box;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: vertical; 
}

/* --- Radio Buttons --- */
.radio-group {
    display: flex;
    gap: 20px;
}
.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
}
.radio-option input[type="radio"] {
    width: auto;
}
.radio-option label {
    margin-bottom: 0;
    font-weight: normal;
    color: #333;
}

/* --- Tag Input --- */
.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    padding: 8px 12px; 
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: text; 
}

.tag-input-container:focus-within {
    border-color: #667eea; 
}

.tag-input-container .tag {
    display: inline-flex;
    align-items: center;
    background-color: #667eea;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: 500;
}

.tag-input-container .tag .tag-remove-btn {
    background: none;
    border: none;
    color: white;
    font-weight: bold;
    margin-left: 8px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 1.1em;
}

#timeline-tag-input,
#event-tag-input,
#linked-events-tag-input {
    flex-grow: 1;
    border: none;
    outline: none;
    padding: 5px 0; 
    font-size: 1em;
    min-width: 150px; 
}

/* --- Color Picker --- */
.color-picker-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 10px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #f0f0f0;
    transition: all 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 2px #667eea;
}

/* --- Kebab Menus / Profile Headers --- */
.profile-header,
#accountModal .profile-header,
#eventDetailsModal .profile-header,
#eventModal .profile-header,
#timelineModal .profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: space-between;
}

#profile-modal-name,
#accountModal .profile-header h2,
#eventDetailsModal .profile-header h2,
#eventModal .profile-header h2,
#timelineModal .profile-header h2 {
    margin-bottom: 0;
    font-size: 1.8em;
    word-wrap: break-word;
    flex-grow: 1;
}

#accountModal .profile-header h2,
#eventDetailsModal .profile-header h2,
#eventModal .profile-header h2 {
    margin-left: 0;
}

/* MODIFIED: Added new Timeline Kebab IDs */
.profile-options-container,
#timeline-options-container,
#canvas-timeline-options {
    position: relative;
    flex-shrink: 0;
}

.profile-options-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.profile-options-btn:hover {
    background-color: #f0f0f0;
}

.profile-options-btn svg {
    width: 20px;
    height: 20px;
    fill: #555;
}

/* MODIFIED: Added new Timeline Kebab IDs */
.profile-options-menu,
#account-options-menu,
#event-details-options-menu,
#event-modal-options-menu,
#timeline-options-menu,
#timeline-options-menu-canvas {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1011;
    width: 160px;
    overflow: hidden;
    padding: 5px 0;
    margin-top: 8px;
    backdrop-filter: none;
}

/* MODIFIED: Added new Timeline Kebab IDs */
.profile-options-menu.show,
#account-options-menu.show,
#event-details-options-menu.show,
#event-modal-options-menu.show,
#timeline-options-menu.show,
#timeline-options-menu-canvas.show {
    display: block;
}

/* MODIFIED: Added new Timeline Kebab IDs */
.profile-options-menu button,
#account-options-menu button,
#event-details-options-menu button,
#event-modal-options-menu button,
#timeline-options-menu button,
#timeline-options-menu-canvas button {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 10px 15px;
    text-align: left;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
}

/* MODIFIED: Added new Timeline Kebab IDs */
.profile-options-menu button:hover,
#account-options-menu button:hover,
#event-details-options-menu button:hover,
#event-modal-options-menu button:hover,
#timeline-options-menu button:hover,
#timeline-options-menu-canvas button:hover {
    background-color: #f9f9f9;
}

.profile-options-menu .profile-delete-option,
#account-options-menu .profile-delete-option,
#event-modal-options-menu .profile-delete-option {
    color: #f44336;
}

#event-details-options-menu button,
#timeline-options-menu button,
#timeline-options-menu-canvas button {
    color: #333;
}

/* --- Notification Badge --- */
.notification-badge {
    position: absolute;
    top: 2px;
    right: 10px;
    width: 10px;
    height: 10px;
    background-color: #e74c3c;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
    z-index: 10;
}

.notification-badge.is-visible {
    display: block;
}

/* --- Misc Components --- */
.details-divider {
    border: none;
    border-top: 1px solid #eee;
    margin-bottom: 20px;
}

/* --- Event Attachments --- */
.attachments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.attachments-section h4 {
    font-size: 0.95em;
    color: #333;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.attachment-upload {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#eventAttachmentInput {
    display: none;
}

.attachment-upload-btn {
    background: transparent;
    color: #36454F;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 400;
    transition: opacity 0.2s;
}

.attachment-upload-btn:hover {
    opacity: 0.7;
}

.attachment-upload-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.attachment-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.attachment-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    display: block;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    word-break: break-word;
    overflow-wrap: break-word;
    font-size: 0.95em;
}

.attachment-name:hover {
    text-decoration: underline;
}

.attachment-meta {
    font-size: 0.85em;
    color: #999;
    margin-top: 4px;
}

.attachment-delete-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 1.3em;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.2s, color 0.2s;
}

.attachment-delete-btn:hover {
    transform: scale(1.2);
    color: #c0392b;
}

/* --- Groups List --- */
.group-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.group-list-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.2s;
}

.group-item:hover {
    background: #f0f0f0;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.group-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2em;
    font-weight: 600;
    flex-shrink: 0;
}

.group-item-info {
    flex: 1;
    min-width: 0;
}

.group-item-name {
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
    word-break: break-word;
}

.group-item-role {
    font-size: 0.85em;
    color: #667eea;
    font-weight: 500;
    display: inline-block;
    padding: 2px 8px;
    background: #f0f4ff;
    border-radius: 4px;
}


/* --- Group Plan Limits & Usage --- */

/* Usage Summary Header */
#groups-list-header {
    margin-bottom: 20px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

#groups-list-header > div:first-child {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Usage Summary & Progress Bar */
.usage-summary {
    margin: 12px 0;
}

.usage-bar {
    width: 100%;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
    border: 1px solid #ddd;
    position: relative;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-size: 0.75em;
    font-weight: 600;
}

.usage-bar.usage-warning .usage-fill {
    background: linear-gradient(90deg, #ff9800 0%, #f57c00 100%);
}

.usage-bar.usage-critical .usage-fill {
    background: linear-gradient(90deg, #f44336 0%, #d32f2f 100%);
}

.usage-status {
    font-size: 0.8em;
    color: #666;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.usage-status.warning {
    color: #ff9800;
    font-weight: 500;
}

.usage-status.critical {
    color: #f44336;
    font-weight: 600;
}

/* Create Group Modal Usage */
#groupCreateUsageSummary {
    margin-bottom: 16px;
    padding: 12px;
    background: #f9f9f9;
    border-left: 3px solid #667eea;
    border-radius: 4px;
}

#groupCreateUsageSummary .usage-bar {
    height: 20px;
    margin-top: 6px;
}

#groupCreateWarning {
    margin-bottom: 16px;
}

/* Limit Warning Banners */
.limit-warning-banner {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-left: 4px solid;
}

.limit-warning-banner.info {
    background: #e3f2fd;
    border-left-color: #2196F3;
    color: #1565c0;
}

.limit-warning-banner.warning {
    background: #fff3e0;
    border-left-color: #ff9800;
    color: #e65100;
}

.limit-warning-banner.critical {
    background: #ffebee;
    border-left-color: #f44336;
    color: #c62828;
}

.limit-warning-banner-icon {
    font-size: 1.2em;
    flex-shrink: 0;
    margin-top: 2px;
}

.limit-warning-banner-content {
    flex: 1;
    line-height: 1.4;
}

.limit-warning-banner-content p {
    margin: 0 0 8px 0;
    font-size: 0.9em;
}

.limit-warning-banner-action {
    margin-top: 8px;
}

.limit-warning-banner-action .btn-small {
    font-size: 0.75em;
    padding: 6px 12px;
}

/* Plan Badges */
.plan-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.plan-badge.basic {
    background: #e0e0e0;
    color: #424242;
    border: 1px solid #999;
}

.plan-badge.plus {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.plan-badge.pro {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.plan-badge.clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.plan-badge.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Plan Indicator in Headers */
.group-context-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.group-header-info {
    flex: 1;
}

.group-header-plan {
    margin-left: auto;
}

.group-header-plan .plan-badge {
    margin-left: 12px;
}

/* Storage Indicator */
.storage-indicator {
    margin: 16px 0;
}

.storage-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
}

.storage-label-text {
    flex: 1;
}

.storage-label-value {
    font-weight: 600;
    color: #333;
}

.storage-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.storage-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.storage-bar.storage-warning .storage-fill {
    background: linear-gradient(90deg, #ff9800 0%, #f57c00 100%);
}

.storage-bar.storage-critical .storage-fill {
    background: linear-gradient(90deg, #f44336 0%, #d32f2f 100%);
}

.storage-status {
    font-size: 0.75em;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

/* Feature Availability Badges */
.feature-availability {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.feature-availability.available {
    background: #e8f5e9;
    color: #2e7d32;
}

.feature-availability.available::before {
    content: "✓";
    font-weight: bold;
}

.feature-availability.unavailable {
    background: #ffebee;
    color: #c62828;
}

.feature-availability.unavailable::before {
    content: "✗";
    font-weight: bold;
}

.feature-unavailable-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    margin: 12px 0;
    background: #fff3e0;
    border-left: 3px solid #ff9800;
    border-radius: 4px;
    color: #e65100;
    font-size: 0.9em;
}

.feature-unavailable-message .icon {
    font-size: 1.2em;
}

.feature-unavailable-message .message {
    flex: 1;
}

.feature-unavailable-message .upgrade-link {
    white-space: nowrap;
    margin-left: auto;
}

/* Member Limit Display */
.member-usage-display {
    font-size: 0.85em;
    color: #666;
    margin: 8px 0;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.member-usage-display.warning {
    background: #fff3e0;
    color: #e65100;
}

.member-usage-display.critical {
    background: #ffebee;
    color: #c62828;
}

.member-slots-remaining {
    font-weight: 600;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .limit-warning-banner {
        flex-direction: column;
    }
    
    .group-context-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .group-header-plan {
        margin-left: 0;
        margin-top: 8px;
    }
    
    #groups-list-header {
        margin-bottom: 12px;
        padding: 8px;
    }
    
    .plan-badge {
        font-size: 0.8em;
        padding: 4px 8px;
    }
}

/* --- Group Settings Tab --- */

.group-settings-container {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.settings-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.settings-section h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1em;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

.storage-section-content,
.plan-section-content,
.info-section-content,
.upgrade-section-content {
    padding: 8px 0;
}

/* Plan Badge Large */
.plan-badge-large {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 16px;
}

.plan-badge-large.basic {
    background: #e0e0e0;
    color: #424242;
    border: 2px solid #999;
}

.plan-badge-large.plus {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.plan-badge-large.pro {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* Plan Features List */
.plan-features {
    margin-top: 12px;
}

.plan-features h4 {
    margin: 12px 0 8px 0;
    color: #333;
    font-size: 0.95em;
}

.plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plan-features li {
    padding-left: 24px;
    position: relative;
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

.plan-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
}

/* Group Details List */
.group-details-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #666;
    min-width: 120px;
    font-size: 0.9em;
}

.detail-value {
    color: #333;
    flex: 1;
    word-break: break-word;
}

/* Upgrade Section */
.upgrade-section {
    background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
    border: 2px solid #ffc107;
}

.upgrade-suggestion {
    padding: 8px 0;
}

.upgrade-suggestion p {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 0.95em;
}

.upgrade-suggestion ul {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upgrade-suggestion li {
    padding-left: 24px;
    position: relative;
    color: #555;
    font-size: 0.9em;
    line-height: 1.4;
}
/* ═══════════════════════════════════════════════════════════════ */
/* GROUP MESSAGING MODAL - Matches Messages modal styling */
/* ═══════════════════════════════════════════════════════════════ */

/* Group Messaging reuses message-modal-content, message-container, message-sidebar, message-main */
/* These are defined in css/5-features.css */

/* Group-specific styling for threads list */
.group-messaging-header-bar {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
}

.group-messaging-header-bar h3 {
    flex: 1;
}

/* Threads list items inherit from friend-list and friend-item */
#group-thread-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
}

#group-thread-list .group-thread-item {
    background: #fff;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    gap: 10px;
}

#group-thread-list .group-thread-item:last-child {
    border-bottom: none;
}

#group-thread-list .group-thread-item:hover {
    background: #f9f9f9;
}

#group-thread-list .group-thread-item.active {
    background: #edf2fa;
}

#group-thread-list .group-thread-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

#group-thread-list .group-thread-title {
    font-weight: 500;
    font-size: 0.95em;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#group-thread-list .group-thread-date {
    font-size: 0.8em;
    color: #888;
    font-weight: 500;
    padding: 0 5px;
    display: block;
}

/* Message header for group (thread selected) */
#group-message-header {
    background: #fafafa;
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
    border-radius: 0;
}

#group-message-header-name {
    font-size: 1.1em;
    color: #333;
    font-weight: normal;
}

/* Group message list (reuses message-window styling) */
.group-message-window {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    border-radius: 0;
}

/* Individual group message styling */
#group-message-list .group-message-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 15px;
    flex-direction: row;
}

#group-message-list .group-message-item.own-message {
    justify-content: flex-end;
}

#group-message-list .group-message-header {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

#group-message-list .group-message-item.own-message .group-message-header {
    display: none;
}

#group-message-list .group-message-text {
    padding: 12px 18px;
    border-radius: 20px;
    background: #e0e0e0;
    color: #333;
    max-width: 70%;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
    border-top-left-radius: 5px;
    display: flex;
    flex-direction: column;
}

#group-message-list .group-message-item.own-message .group-message-text {
    background: #667eea;
    color: white;
    border-top-right-radius: 5px;
    border-top-left-radius: 20px;
}

/* Group message input area */
#group-message-input-area {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background: #fff;
    margin-bottom: 0;
}

#group-message-input {
    flex-grow: 1;
    border: 2px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 1em;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    max-height: 130px;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#group-message-input:focus {
    border-color: #667eea;
}

#group-message-send-btn {
    flex-shrink: 0;
    background: #667eea;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    color: white;
    padding: 0;
    margin-bottom: 5px;
}

#group-message-send-btn:hover {
    background: #5567d8;
}

#group-message-send-btn svg {
    width: 20px;
    height: 20px;
    margin-left: 2px;
}
.upgrade-suggestion li::before {
    content: "→";
    position: absolute;
    left: 6px;
    color: #ffc107;
    font-weight: bold;
}

/* Responsive Settings */
@media (max-width: 768px) {
    .group-settings-container {
        padding: 12px;
    }
    
    .settings-section {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .plan-badge-large {
        padding: 10px 20px;
        font-size: 1em;
    }
    
    .detail-item {
        flex-direction: column;
        gap: 4px;
    }
    
    .detail-label {
        min-width: auto;
    }
}

/* --- Group Lifecycle Actions --- */

.group-context-menu {
    position: relative;
}

.group-context-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

.group-context-menu-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9em;
    color: #666;
    transition: background 0.2s;
}

.group-context-menu-dropdown button:hover {
    background: #f5f5f5;
}

.group-context-menu-dropdown button:active {
    background: #efefef;
}

.group-context-menu-dropdown button.danger {
    color: #f44336;
}

.group-context-menu-dropdown button.danger:hover {
    background: #ffebee;
}

/* Lifecycle actions section in Settings */
.lifecycle-actions-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.danger-zone {
    border: 2px solid #f44336 !important;
    background: #ffebee !important;
}

.danger-zone h3 {
    color: #c62828 !important;
    margin-top: 0;
}

.lifecycle-action-button {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    width: 100%;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.2s;
    gap: 8px;
}

.lifecycle-action-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lifecycle-action-button:active:not(:disabled) {
    transform: translateY(0);
}

.lifecycle-action-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lifecycle-action-button.transfer {
    background: #ffc107;
    color: #333;
}

.lifecycle-action-button.transfer:hover:not(:disabled) {
    background: #ffb300;
}

.lifecycle-action-button.delete {
    background: #f44336;
    color: white;
}

.lifecycle-action-button.delete:hover:not(:disabled) {
    background: #d32f2f;
}

.lifecycle-action-button.leave {
    background: #f44336;
    color: white;
}

.lifecycle-action-button.leave:hover:not(:disabled) {
    background: #d32f2f;
}

/* Transfer ownership modal */
#transferOwnershipModal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

#transferOwnershipModal .modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

#transferOwnershipModal h2 {
    margin-top: 0;
    color: #333;
}

.transfer-member-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.transfer-member-option:hover {
    background: #f5f5f5;
}

.transfer-member-option input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
}

.transfer-member-info {
    flex: 1;
}

.transfer-member-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.transfer-member-email {
    font-size: 0.85em;
    color: #999;
}

.transfer-member-role {
    display: inline-block;
    font-size: 0.75em;
    color: #999;
    margin-left: 4px;
}

/* Transfer warning box */
.transfer-warning {
    background: #fff3e0;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #ff9800;
    margin: 16px 0;
    font-size: 0.9em;
    color: #e65100;
}

.transfer-warning strong {
    color: #e65100;
    display: block;
    margin-bottom: 8px;
}

.transfer-warning ul {
    list-style: none;
    padding-left: 12px;
    margin: 0;
}

.transfer-warning li {
    padding: 2px 0;
}

.transfer-warning li::before {
    content: "• ";
    margin-right: 6px;
}
