/**
 * CROWNED Post Upload Styles
 * Simplified upload form for community posts
 */

/* Container */
.post-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 6rem 1.5rem 3rem;
}

.post-header {
    text-align: center;
    margin-bottom: 2rem;
}

.post-header h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.post-header p {
    color: var(--color-text-muted);
}

/* Form */
.post-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Image Upload */
.post-image-section {
    margin-bottom: 0.5rem;
}

.post-drop-zone {
    position: relative;
    border: 2px dashed var(--color-border);
    border-radius: 12px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    background: var(--color-bg-elevated);
}

.post-drop-zone:hover {
    border-color: var(--color-gold);
    background: rgba(212, 175, 55, 0.02);
}

.post-drop-zone.drag-over {
    border-color: var(--color-gold);
    background: rgba(212, 175, 55, 0.05);
}

.post-upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-muted);
    text-align: center;
    padding: 2rem;
}

.post-upload-prompt svg {
    color: var(--color-gold);
    opacity: 0.7;
}

.post-upload-prompt span {
    font-size: 1rem;
}

.post-upload-prompt small {
    font-size: 0.75rem;
    opacity: 0.7;
}

.post-preview {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 300px;
    position: relative;
}

.post-preview img {
    width: 100%;
    height: 100%;
    min-height: 300px;
    max-height: 500px;
    object-fit: cover;
}

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

.remove-image:hover {
    background: var(--error);
    transform: scale(1.1);
}

/* Caption */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group label .optional {
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: 0.85em;
}

.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-elevated);
    color: var(--color-text);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--color-gold);
}

.form-group textarea::placeholder {
    color: var(--color-text-muted);
}

.char-count {
    align-self: flex-end;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Category Chips */
.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-chip {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: transparent;
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-chip:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}

.category-chip.active {
    background: var(--color-gold);
    border-color: var(--color-gold);
    color: var(--color-bg);
}

/* Tags Input */
.tags-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-elevated);
    min-height: 48px;
    align-items: center;
}

.tags-input-wrapper:focus-within {
    border-color: var(--color-gold);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(212, 175, 55, 0.15);
    color: var(--color-gold);
    border-radius: 4px;
    font-size: 0.875rem;
}

.tag-remove {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-gold);
    opacity: 0.7;
    display: flex;
    align-items: center;
}

.tag-remove:hover {
    opacity: 1;
}

#tag-input {
    flex: 1;
    min-width: 120px;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

#tag-input::placeholder {
    color: var(--color-text-muted);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Actions */
.post-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.post-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#post-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spinner animation */
.spinner {
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 640px) {
    .post-container {
        padding: 5rem 1rem 2rem;
    }

    .post-header h1 {
        font-size: 1.5rem;
    }

    .post-drop-zone {
        min-height: 250px;
    }

    .post-preview img {
        min-height: 250px;
    }

    .post-actions {
        flex-direction: column;
    }

    .post-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
