/**
 * Create Thread Page Styles
 * 
 * @package BG_Scammers
 */

/* ============================================
   CREATE THREAD FORM
   ============================================ */

.create-thread-page {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.create-thread-form {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.create-thread-form .page-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.create-thread-form .form-description {
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color-1);
    box-shadow: 0 0 0 3px rgba(106, 84, 46, 0.1);
}

.form-control.error {
    border-color: #dc3545;
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
    line-height: 1.6;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.form-help {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.file-label {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--hover-bg);
    border: 2px dashed var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-label:hover {
    border-color: var(--accent-color-1);
    background: rgba(106, 84, 46, 0.05);
}

.file-label-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.file-label-text svg {
    flex-shrink: 0;
}

/* Image Preview */
/* Drag and Drop Zone */
.drag-drop-zone {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: var(--bg-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.drag-drop-zone:hover {
    border-color: var(--accent-color-1, #6a542e);
    background: rgba(106, 84, 46, 0.05);
}

.drag-drop-zone.drag-over {
    border-color: var(--accent-color-1, #6a542e);
    background: rgba(106, 84, 46, 0.1);
    transform: scale(1.02);
}

.file-label {
    display: block;
    cursor: pointer;
    margin: 0;
}

.file-label-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.file-label-text svg {
    width: 48px;
    height: 48px;
    color: var(--accent-color-1);
    margin-bottom: 0.5rem;
}

.drag-drop-text {
    font-size: 1rem;
    font-weight: 500;
}

.click-to-browse {
    font-size: 0.875rem;
    color: var(--accent-color-1);
    text-decoration: underline;
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Image Preview Container - Grid of Squares */
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-preview-item {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-color);
}

.image-preview-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-preview-item .remove-image {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    z-index: 10;
    opacity: 0;
}

.image-preview-item:hover .remove-image {
    opacity: 1;
}

.image-preview-item .remove-image:hover {
    background: rgba(220, 53, 69, 0.9);
    transform: scale(1.1);
}

.image-preview-item .remove-image svg {
    width: 14px;
    height: 14px;
}

/* Responsive adjustments for image grid */
@media (max-width: 768px) {
    .image-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    
    .drag-drop-zone {
        padding: 1.5rem;
    }
    
    .file-label-text svg {
        width: 40px;
        height: 40px;
    }
}

/* Video Upload - Drag and Drop Zone */
.video-drag-drop-zone {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: var(--bg-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-drag-drop-zone:hover {
    border-color: var(--accent-color-1);
    background: rgba(106, 84, 46, 0.05);
}

.video-drag-drop-zone.drag-over {
    border-color: var(--accent-color-1);
    background: rgba(106, 84, 46, 0.1);
    transform: scale(1.02);
}

/* Video Preview Container */
.video-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.video-preview-item {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-color);
}

.video-preview-wrapper {
    position: relative;
    width: 100%;
    background: #000;
}

.video-preview-wrapper video {
    width: 100%;
    height: auto;
    display: block;
    max-height: 300px;
}

.video-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.video-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    word-break: break-word;
}

.video-size {
    font-size: 0.75rem;
    color: #666;
}

.video-preview-item .remove-video {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    z-index: 10;
    opacity: 0;
}

.video-preview-item:hover .remove-video {
    opacity: 1;
}

.video-preview-item .remove-video:hover {
    background: rgba(220, 53, 69, 0.9);
    transform: scale(1.1);
}

.video-preview-item .remove-video svg {
    width: 14px;
    height: 14px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.form-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-color-1);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-color-2);
    color: white;
}

.btn-secondary {
    background: var(--hover-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Form Messages */
.form-message {
    margin-top: 1.5rem;
}

.notification {
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.notification-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Login Required Message */
.login-required-message {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.login-required-message h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.login-required-message p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.login-required-message .button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--accent-color-1);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.login-required-message .button:hover {
    background: var(--accent-color-2);
    color: white;
}

/* TinyMCE Icon Font Fix - Additional styles in wp_head via class-public.php */
.mce-ico,
.mce-btn .mce-ico,
button .mce-ico,
.mce-widget .mce-ico,
.mce-container .mce-ico {
    font-family: 'tinymce', Arial !important;
    font-style: normal !important;
    font-weight: 400 !important;
    font-variant: normal !important;
    font-size: 16px !important;
    line-height: 16px !important;
    speak: none !important;
    text-transform: none !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    display: inline-block !important;
    text-rendering: auto !important;
}

/* Tags Input */
.tags-input-wrapper {
    position: relative;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 42px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    margin-bottom: 0.5rem;
}

.tags-container:empty {
    display: none;
    margin-bottom: 0;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--accent-color-1);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
}

.tag-item .tag-text {
    flex: 1;
}

.tag-item .tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    transition: background 0.2s ease;
}

.tag-item .tag-remove:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tags-input {
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .create-thread-form {
        padding: 1.5rem;
    }
    
    .create-thread-form .page-title {
        font-size: 1.5rem;
    }
    
    .video-input-wrapper,
    .video-field-item {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .image-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    .video-preview-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .video-preview-wrapper video {
        max-height: 200px;
    }
}

