/* Create Post Form - Intuitive Design */
.create-post-card {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.2s ease;
}

.create-post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.create-post-header {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.create-post-header .avatar-small {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.post-textarea {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.9375rem;
    line-height: 1.5;
    resize: none;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--gray-50);
    min-height: 75px;
    max-height: 300px;
    width: 100%;
    box-sizing: border-box;
}

.post-textarea::placeholder {
    color: var(--gray-400);
    font-style: italic;
    opacity: 0.8;
}

.post-textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    background: white;
    box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.1);
}

.post-textarea:not(:placeholder-shown) {
    background: white;
    border-color: var(--gray-300);
}

.post-textarea.missing-hashtag {
    border-color: var(--secondary-400);
    background: var(--secondary-50);
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.1);
}

.post-helper-text {
    transition: color 0.2s ease;
}

.post-helper-text.warning {
    color: var(--secondary-600);
    font-weight: 500;
}

/* Post Actions - Always Visible but Subtle */
.create-post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-200);
    margin-top: 0.5rem;
}

.post-tools {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.tool-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-600);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.15);
}

.tool-btn:active {
    transform: translateY(0);
}

.tool-btn svg {
    width: 18px;
    height: 18px;
}

.tool-btn[data-active="true"] {
    background: var(--primary-100);
    border-color: var(--primary-500);
    color: var(--primary-700);
}

.tool-btn .tool-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.tool-btn:hover .tool-label {
    opacity: 1;
}

/* Submit Button */
.create-post-actions .btn-primary {
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 6px;
    background: var(--primary-600);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.create-post-actions .btn-primary:hover:not(:disabled) {
    background: var(--primary-700);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
}

.create-post-actions .btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.create-post-actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Media Preview */
#mediaPreview {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 12px;
    border: 2px dashed var(--gray-300);
}

.media-preview-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Image Thumbnails Grid */
.media-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.media-thumbnail {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.2s ease;
}

.media-thumbnail:hover {
    border-color: var(--primary-500);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.media-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-thumbnail .remove-thumbnail {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.media-thumbnail:hover .remove-thumbnail {
    opacity: 1;
}

.media-thumbnail .remove-thumbnail:hover {
    background: rgba(220, 38, 38, 0.9);
}

.media-thumbnail .remove-thumbnail svg {
    width: 14px;
    height: 14px;
}

.media-preview-content img,
.media-preview-content video {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    object-fit: contain;
    background: var(--gray-100);
}

/* Single large media preview */
.media-preview-large {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--gray-100);
}

.media-preview-large img,
.media-preview-large video {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
}

.media-preview-content .youtube-preview {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: var(--gray-900);
}

.media-preview-content .youtube-preview iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.btn-remove-media {
    align-self: flex-start;
    padding: 0.5rem 1rem;
    background: var(--gray-200);
    color: var(--gray-700);
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-remove-media:hover {
    background: var(--red-100);
    color: var(--red-700);
}

.btn-remove-media svg {
    width: 16px;
    height: 16px;
}

/* Character Counter */
.character-counter {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    padding-right: 0.5rem;
}

.character-counter.warning {
    color: var(--orange-600);
}

.character-counter.error {
    color: var(--red-600);
    font-weight: 600;
}

/* Helper Text */
.post-helper-text {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
    padding-left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-helper-text svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Media Selection Indicator */
.media-selected-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-50);
    color: var(--primary-700);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.media-selected-indicator svg {
    width: 16px;
    height: 16px;
}

/* Loading State */
.create-post-form.loading .btn-primary {
    position: relative;
    color: transparent;
}

.create-post-form.loading .btn-primary::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success Animation */
.create-post-form.success {
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Responsive */
@media (max-width: 768px) {
    .create-post-card {
        padding: 0.5rem;
    }
    
    .create-post-header {
        gap: 0.5rem;
    }
    
    .post-textarea {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .create-post-actions {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .post-tools {
        width: 100%;
        justify-content: space-between;
    }
    
    .create-post-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* Empty State Enhancement */
.create-post-card:has(.post-textarea:placeholder-shown) .create-post-actions {
    opacity: 0.6;
}

.create-post-card:has(.post-textarea:not(:placeholder-shown)) .create-post-actions {
    opacity: 1;
}

