/**
 * Rumour Edit Modal
 * Matches LifeList standard modal pattern
 * 9:16 portrait post editor with live preview
 */

/* Modal Overlay (Standard Pattern) */
#rumourEditModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100010; /* Matches editStampModal */
    justify-content: center;
    align-items: center;
}

#rumourEditModal.active {
    display: flex;
}

/* Modal Content */
#rumourEditModal .modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1100px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin: 0 !important;
    position: relative;
}

/* Modal Header (Close Button Top Right - Overlays Preview) */
#rumourEditModal .modal-header {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 0;
    z-index: 100;
    border: none;
    background: transparent;
    width: auto;
    height: auto;
    display: block;
}

#rumourEditModal .modal-close {
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    color: #666;
    padding: 0 !important;
    margin: 0 !important;

#rumourEditModal .modal-close:hover {
    background: white;
    transform: scale(1.1);
    color: #333;
}

/* Left Panel - Preview */
.rumour-preview-panel {
    flex: 1;
    background: #000;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    min-width: 0;
}

.rumour-preview-label {
    display: none; /* Hide label for full-width preview */
}

.rumour-preview-canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    background: #000;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    position: relative;
    flex: 1;
}

/* Right Panel - Edit Form (Modal Body Pattern) */
#rumourEditModal .modal-body {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    padding: 0;
}

/* Tabs */
.rumour-edit-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    background: white;
    padding: 0 30px;
    margin-top: 60px; /* Space for close button */
}

.rumour-tab {
    padding: 16px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.rumour-tab:hover {
    color: #111827;
}

.rumour-tab.active {
    color: #1C2E3D;
    border-bottom-color: #1C2E3D;
    font-weight: 600;
}

/* Tab Content */
.rumour-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: none;
}

.rumour-tab-content.active {
    display: block;
}

/* Form Fields */
.rumour-form-group {
    margin-bottom: 24px;
}

.rumour-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.rumour-form-input,
.rumour-form-textarea,
.rumour-form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.rumour-form-input:focus,
.rumour-form-textarea:focus,
.rumour-form-select:focus {
    outline: none;
    border-color: #1C2E3D;
}

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

/* Character Counter */
.rumour-char-counter {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.rumour-char-counter.warning {
    color: #f59e0b;
}

.rumour-char-counter.error {
    color: #ef4444;
}

/* Color Picker */
.rumour-color-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rumour-color-input {
    width: 60px;
    height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
}

.rumour-color-hex {
    flex: 1;
}

/* Range Slider */
.rumour-range-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rumour-range-input {
    flex: 1;
}

.rumour-range-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #374151;
}

/* Button Group */
.rumour-button-group {
    display: flex;
    gap: 8px;
}

.rumour-button {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s ease;
}

.rumour-button:hover {
    border-color: #1C2E3D;
    background: #f9fafb;
}

.rumour-button.active {
    border-color: #1C2E3D;
    background: #1C2E3D;
    color: white;
}

/* File Upload */
.rumour-file-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rumour-file-upload:hover {
    border-color: #1C2E3D;
    background: #f9fafb;
}

.rumour-file-upload i {
    font-size: 32px;
    color: #6b7280;
    margin-bottom: 12px;
}

.rumour-file-upload-text {
    font-size: 14px;
    color: #6b7280;
}

.rumour-file-upload input[type="file"] {
    display: none;
}

/* Relationship Search */
.rumour-relationship-search {
    position: relative;
}

.rumour-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.rumour-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 10;
}

.rumour-search-results.active {
    display: block;
}

.rumour-search-result {
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.rumour-search-result:hover {
    background: #f9fafb;
}

.rumour-search-result:last-child {
    border-bottom: none;
}

/* Selected Items */
.rumour-selected-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.rumour-selected-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 16px;
    font-size: 13px;
}

.rumour-remove-item {
    background: none;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.rumour-remove-item:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Save Button */
.rumour-save-actions {
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: white;
}

.rumour-btn-cancel,
.rumour-btn-save {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.rumour-btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.rumour-btn-cancel:hover {
    background: #e5e7eb;
}

.rumour-btn-save {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.rumour-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #rumourEditModal .modal-content {
        flex-direction: column;
        max-height: 95vh;
        width: 95%;
    }
    
    .rumour-preview-panel {
        padding: 20px;
        min-height: 200px;
    }
    
    .rumour-preview-canvas {
        max-width: 200px;
        height: 356px;
    }
    
    #rumourEditModal .modal-header {
        padding: 15px;
    }
    
    .rumour-edit-tabs {
        padding: 0 20px;
        margin-top: 50px;
        overflow-x: auto;
    }
    
    .rumour-tab {
        padding: 12px 16px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .rumour-tab-content {
        padding: 20px;
    }
    
    .rumour-save-actions {
        padding: 15px 20px;
    }
}
