/* ============================================
   GENZFLOW — CREATE PAGE
   ============================================ */

/* ---- Section Spacing ---- */
.create-section {
    margin-bottom: var(--space-4);
}

.create-section-title {
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

/* ============================================
   SECTION 1 — VIDEO UPLOAD
   ============================================ */
.upload-area {
    display: flex;
    gap: var(--space-3);
}

.upload-dropzone {
    flex: 1;
    min-height: 240px;
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    cursor: pointer;
    transition: all var(--transition-normal);
    background-color: var(--bg-surface);
    padding: var(--space-4);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary-accent);
    background-color: var(--accent-soft);
}

.upload-dropzone-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background-color: var(--accent-soft);
    color: var(--primary-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-dropzone-icon i {
    width: 24px;
    height: 24px;
    stroke-width: 1.75;
}

.upload-dropzone-label {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.upload-dropzone-hint {
    font-size: var(--font-size-caption);
    color: var(--text-muted);
}

.upload-dropzone-browse {
    color: var(--primary-accent);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.upload-dropzone-browse:hover {
    text-decoration: underline;
}

/* Hidden file input */
.upload-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ---- Upload Sidebar (Thumbnail + Info) ---- */
.upload-sidebar {
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex-shrink: 0;
}

.thumbnail-upload {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    cursor: pointer;
    transition: all var(--transition-fast);
    background-color: var(--bg-surface);
    position: relative;
    overflow: hidden;
}

.thumbnail-upload:hover {
    border-color: var(--primary-accent);
    background-color: var(--accent-soft);
}

.thumbnail-upload i {
    width: 20px;
    height: 20px;
    stroke-width: 1.75;
    color: var(--text-muted);
}

.thumbnail-upload span {
    font-size: var(--font-size-caption);
    color: var(--text-muted);
}

.thumbnail-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Video preview placeholder */
.video-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: var(--bg-input);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
}

.video-preview i {
    width: 32px;
    height: 32px;
    stroke-width: 1.5;
    color: var(--text-muted);
}

/* File info */
.file-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.file-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-1) 0;
}

.file-info-label {
    font-size: var(--font-size-caption);
    color: var(--text-muted);
}

.file-info-value {
    font-size: var(--font-size-caption);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
}

/* ============================================
   SECTION 2 — PLATFORM SELECTION
   ============================================ */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
}

.platform-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-2);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.platform-card:hover {
    border-color: var(--border-default);
    background-color: var(--bg-hover);
}

.platform-card.selected {
    border-color: var(--primary-accent);
    background-color: var(--accent-soft);
}

.platform-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.platform-card-icon i {
    width: 22px;
    height: 22px;
    stroke-width: 1.75;
}

/* Platform-specific icon colors */
.platform-card[data-platform="instagram"] .platform-card-icon {
    background-color: rgba(225, 48, 108, 0.12);
    color: #e1306c;
}

.platform-card[data-platform="facebook"] .platform-card-icon {
    background-color: rgba(24, 119, 242, 0.12);
    color: #1877f2;
}

.platform-card[data-platform="youtube"] .platform-card-icon {
    background-color: rgba(255, 0, 0, 0.12);
    color: #ff0000;
}

.platform-card[data-platform="tiktok"] .platform-card-icon {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.platform-card-label {
    font-size: var(--font-size-caption);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.platform-card.selected .platform-card-label {
    color: var(--text-primary);
}

.platform-card-check {
    position: absolute;
    top: var(--space-1);
    right: var(--space-1);
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background-color: var(--primary-accent);
    color: var(--text-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-fast);
}

.platform-card.selected .platform-card-check {
    opacity: 1;
    transform: scale(1);
}

.platform-card-check i {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
}

.platform-card {
    position: relative;
}

/* ============================================
   SECTION 3 — PLATFORM TABS
   ============================================ */
.platform-tabs-section {
    display: none;
}

.platform-tabs-section.visible {
    display: block;
}

.platform-tabs-bar {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-3);
}

.platform-tab {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-fast);
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
}

.platform-tab:hover {
    color: var(--text-primary);
}

.platform-tab.active {
    color: var(--primary-accent);
    border-bottom-color: var(--primary-accent);
}

.platform-tab i {
    width: 16px;
    height: 16px;
    stroke-width: 1.75;
}

/* Tab content panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Form fields inside tabs */
.form-group {
    margin-bottom: var(--space-3);
}

.form-label {
    display: block;
    font-size: var(--font-size-caption);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-textarea {
    width: 100%;
    min-height: 100px;
    padding: var(--space-2);
    background-color: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--font-size-body);
    font-family: var(--font-family);
    line-height: var(--line-height-normal);
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-select {
    width: 100%;
    padding: 10px var(--space-2);
    padding-right: var(--space-5);
    background-color: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--font-size-body);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-select:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Hashtag input */
.hashtag-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    padding: var(--space-1);
    background-color: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    min-height: 44px;
    align-items: center;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    cursor: text;
}

.hashtag-input-wrapper:focus-within {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.hashtag-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px var(--space-1);
    background-color: var(--accent-soft);
    color: var(--primary-accent);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-caption);
    font-weight: var(--font-weight-medium);
}

.hashtag-tag-remove {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.hashtag-tag-remove:hover {
    opacity: 1;
}

.hashtag-tag-remove i {
    width: 12px;
    height: 12px;
    stroke-width: 2;
}

.hashtag-input-field {
    border: none;
    outline: none;
    background: none;
    color: var(--text-primary);
    font-size: var(--font-size-body);
    padding: 4px var(--space-1);
    flex: 1;
    min-width: 120px;
}

.hashtag-input-field::placeholder {
    color: var(--text-muted);
}

/* ============================================
   SECTION 4 — SCHEDULING
   ============================================ */
.schedule-section {
    display: flex;
    align-items: flex-end;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.schedule-toggle {
    display: flex;
    gap: 2px;
    background-color: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border-subtle);
}

.schedule-toggle-btn {
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    border: none;
    background: none;
}

.schedule-toggle-btn.active {
    background-color: var(--primary-accent);
    color: var(--text-on-accent);
    box-shadow: 0 2px 6px hsla(245, 70%, 62%, 0.25);
}

.schedule-toggle-btn:not(.active):hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

.schedule-datetime {
    display: none;
    align-items: flex-end;
    gap: var(--space-2);
}

.schedule-datetime.visible {
    display: flex;
}

.schedule-datetime .form-group {
    margin-bottom: 0;
}

.schedule-date-input,
.schedule-time-input {
    padding: 10px var(--space-2);
    background-color: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--font-size-body);
    font-family: var(--font-family);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.schedule-date-input:focus,
.schedule-time-input:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Color scheme for date/time pickers in dark mode */
.schedule-date-input::-webkit-calendar-picker-indicator,
.schedule-time-input::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(0.7);
}

.schedule-publish {
    margin-left: auto;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .upload-area {
        flex-direction: column;
    }

    .upload-sidebar {
        width: 100%;
        flex-direction: row;
    }

    .thumbnail-upload {
        width: 50%;
    }

    .video-preview {
        display: none;
    }

    .platform-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .upload-sidebar {
        flex-direction: column;
    }

    .thumbnail-upload {
        width: 100%;
    }

    .platform-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .schedule-section {
        flex-direction: column;
        align-items: stretch;
    }

    .schedule-datetime {
        flex-direction: column;
    }

    .schedule-publish {
        margin-left: 0;
    }
}