/**
 * Content Input Component Styles
 * Location: /public_html/posts/assets/content-input.css
 * 
 * Styles for the reusable content input component
 * Works across profile, timeline, messages, and community contexts
 */

/* ============================================================
   BASE CONTAINER
   ============================================================ */

.create-post-card,
.message-input-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.create-post-card:focus-within,
.message-input-card:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

/* Community-specific styling */
.community-post-card {
    border-left: 3px solid #F9C94C;
}

/* ============================================================
   HEADER (Avatar + Input)
   ============================================================ */

.content-input-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.content-input-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e2e8f0;
}

/* Text input field */
.content-input-field {
    flex: 1;
    border: none;
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    color: #0f172a;
    resize: none;
    transition: background-color 0.2s ease;
}

.content-input-field:focus {
    outline: none;
    background: #f1f5f9;
}

.content-input-field::placeholder {
    color: #94a3b8;
}

/* Single line input (messages) */
.content-input-single {
    padding: 10px 16px;
}

/* Textarea (posts) */
.content-input-textarea {
    min-height: 44px;
    max-height: 200px;
    overflow-y: auto;
}

/* ============================================================
   MEDIA BUTTONS
   ============================================================ */

.content-input-media-buttons {
    display: flex;
    gap: 4px;
    padding: 12px 0 0 56px;
    /* Align with input (avatar width + gap) */
    border-top: none;
    margin-top: 8px;
}

.media-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.media-btn:hover {
    background: #e2e8f0;
}

.media-btn-image:hover {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.media-btn-audio:hover {
    color: #0891b2;
    background: rgba(8, 145, 178, 0.1);
}

.media-btn-video:hover {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
}

.media-btn-document:hover {
    color: #e11d48;
    background: rgba(225, 29, 72, 0.1);
}

/* ============================================================
   FILE PREVIEW
   ============================================================ */

.content-input-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 0 56px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.preview-content {
    flex: 1;
    min-width: 0;
}

.preview-image {
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    object-fit: cover;
}

.preview-file {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preview-filename {
    font-size: 14px;
    color: #475569;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.preview-remove-btn:hover {
    background: #fecaca;
    transform: scale(1.1);
}

/* ============================================================
   FOOTER (Info + Submit)
   ============================================================ */

.content-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.content-input-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #94a3b8;
}

.content-input-submit {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
}

.content-input-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   MESSAGES CONTEXT OVERRIDES
   ============================================================ */

.message-input-card {
    position: fixed;
    bottom: 0;
    left: 280px;
    /* Sidebar width */
    right: 0;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 12px 20px;
    z-index: 100;
}

.message-input-card .content-input-header {
    align-items: center;
}

.message-input-card .content-input-avatar {
    width: 36px;
    height: 36px;
}

.message-input-card .content-input-media-buttons {
    padding-left: 0;
    margin-top: 0;
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
}

.message-input-card .media-btn {
    width: 32px;
    height: 32px;
}

.message-input-card .content-input-footer {
    display: none;
    /* Hide info text in messages */
}

.message-input-card .content-input-submit {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 16px;
}

.message-input-card .content-input-preview {
    margin-left: 48px;
    margin-bottom: 8px;
}

/* ============================================================
   DARK MODE (for pages with dark theme)
   ============================================================ */

body[data-theme="dark"] .create-post-card,
body[data-theme="dark"] .message-input-card,
.app-dark .create-post-card,
.app-dark .message-input-card {
    background: #1e293b;
    border-color: #334155;
}

body[data-theme="dark"] .content-input-field,
.app-dark .content-input-field {
    background: #0f172a;
    color: #f1f5f9;
}

body[data-theme="dark"] .content-input-field:focus,
.app-dark .content-input-field:focus {
    background: #1e293b;
}

body[data-theme="dark"] .media-btn,
.app-dark .media-btn {
    background: #334155;
    color: #94a3b8;
}

body[data-theme="dark"] .media-btn:hover,
.app-dark .media-btn:hover {
    background: #475569;
}

body[data-theme="dark"] .content-input-preview,
.app-dark .content-input-preview {
    background: #0f172a;
    border-color: #334155;
}

body[data-theme="dark"] .preview-filename,
.app-dark .preview-filename {
    color: #cbd5e1;
}

body[data-theme="dark"] .content-input-footer,
.app-dark .content-input-footer {
    border-top-color: #334155;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .content-input-media-buttons {
        padding-left: 0;
    }

    .content-input-preview {
        margin-left: 0;
    }

    .content-input-avatar {
        width: 36px;
        height: 36px;
    }

    .message-input-card {
        left: 0;
    }

    .message-input-card .content-input-media-buttons {
        position: static;
        transform: none;
        margin-top: 8px;
    }

    .message-input-card .content-input-submit {
        position: static;
        transform: none;
        margin-top: 8px;
        width: 100%;
    }
}