/* Dashboard-specific styles for Creator AI */

/* X API Configuration Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-container {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #1e293b;
}

.modal-content {
    padding: 0 24px;
}

.api-config-intro {
    margin-bottom: 24px;
}

.api-config-intro p {
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

/* config-status styles removed - no longer needed */

.credentials-form {
    margin-bottom: 32px;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-field input:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.field-help {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.4;
}

.connection-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    align-items: center;
}

.connection-actions button {
    flex: 1;
    text-align: center;
}

.instructions-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.instructions-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.instructions-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #007AFF;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    margin-bottom: 4px;
    color: #1e293b;
    font-weight: 600;
}

.step-content p {
    color: #64748b;
    line-height: 1.5;
    margin: 0;
    font-size: 14px;
}

.step-content a {
    color: #007AFF;
    text-decoration: none;
}

.step-content a:hover {
    text-decoration: underline;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.footer-status {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.footer-status.success {
    color: #4CAF50;
}

.footer-status.error {
    color: #f44336;
}

.footer-status.info {
    color: #007AFF;
}

.footer-actions {
    display: flex;
    gap: 12px;
}

.secondary-button, .primary-button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.secondary-button {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.secondary-button:hover:not(:disabled) {
    background: #f1f5f9;
    color: #475569;
}

.primary-button {
    background: #007AFF;
    color: white;
}

.primary-button:hover:not(:disabled) {
    background: #0056b3;
}

.secondary-button:disabled,
.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* X API Configuration Prompt */
.x-api-config-prompt {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 12px;
    margin: 20px 0;
    padding: 20px;
}

.config-prompt-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.config-prompt-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.config-prompt-text {
    flex: 1;
}

.config-prompt-text h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #92400e;
}

.config-prompt-text p {
    margin: 0;
    font-size: 14px;
    color: #92400e;
    line-height: 1.4;
}

#configure-x-api-btn {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

#configure-x-api-btn:hover {
    background: #d97706;
}

/* Dashboard Layout */
.dashboard-content {
    display: flex;
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Sidebar Navigation */
.sidebar-nav {
    width: 260px;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    padding: 32px 0;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.04);
    position: relative;
}

.sidebar-nav::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    opacity: 0.3;
}

.nav-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 24px;
}

.nav-tab-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px 20px;
    border: none;
    background: transparent;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 122, 255, 0.08), transparent);
    transition: left 0.5s;
}

.nav-tab-btn:hover {
    background: rgba(0, 122, 255, 0.05);
    color: var(--primary-color);
    transform: translateX(4px);
}

.nav-tab-btn:hover::before {
    left: 100%;
}

.nav-tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
    transform: translateX(4px);
}

.nav-tab-btn.active::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 40px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px 0 0 2px;
}

.nav-tab-icon {
    font-size: 18px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.nav-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 3px;
    transition: var(--transition);
    filter: grayscale(100%) opacity(0.7);
}

.nav-tab-btn:hover .nav-logo {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

.nav-tab-btn.active .nav-logo {
    filter: grayscale(0%) opacity(1) brightness(1.2);
    transform: scale(1.1);
}

.nav-tab-btn:hover .nav-tab-icon,
.nav-tab-btn.active .nav-tab-icon {
    transform: scale(1.1);
}

/* Main Content Area */
.main-content-area {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    position: relative;
}

.main-content-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 122, 255, 0.2), transparent);
}

.content-section {
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section.hidden {
    display: none;
}

/* Section Header */
.section-header {
    margin-bottom: 40px;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 32px;
    position: relative;
}


.section-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.section-description {
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1.5;
    font-weight: 400;
}

/* Content Generator Layout */
.content-generator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 64px;
    align-items: stretch;
}

/* Input Area */
.input-area {
    background: var(--surface-color);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.06);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.input-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.input-area:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-field textarea,
.form-field input[type="text"],
.form-field select {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: var(--surface-color);
    color: var(--text-primary);
    transition: var(--transition);
    resize: vertical;
    line-height: 1.5;
}

.form-field textarea:focus,
.form-field input[type="text"]:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15), 0 4px 20px rgba(0, 122, 255, 0.1);
    transform: translateY(-1px);
}

.input-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 122, 255, 0.04);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

/* Generation Options */
.generation-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
    padding: 20px;
    background: rgba(0, 122, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(0, 122, 255, 0.08);
}

.option-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0;
}

/* Custom Checkbox */
.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
}

input[type="checkbox"] {
    display: none;
}

input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Image Generation Group - Special layout for image options */
.image-generation-group {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.image-generation-group .checkbox-container {
    display: flex;
    align-items: center;
}

/* Image Model Selection Dropdown */
.image-model-selection {
    width: 100%;
    margin-left: 26px; /* Align with checkbox text */
}

.model-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
}

.model-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.model-select:hover {
    border-color: #c1c9d2;
}

/* Disable model selection when image generation is unchecked */
.image-model-selection.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.image-model-selection.disabled .model-select {
    background-color: #f8f9fa;
    color: #9ca3af;
}

/* Buttons */
.primary-button {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 3px 12px rgba(0, 122, 255, 0.25);
    position: relative;
    overflow: hidden;
}

.primary-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.primary-button:hover {
    background: linear-gradient(135deg, #0056b3, #003d82);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4);
}

.primary-button:hover::before {
    left: 100%;
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.secondary-button {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.secondary-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
    transition: left 0.5s;
}

.secondary-button:hover {
    background: var(--background-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.secondary-button:hover::before {
    left: 100%;
}

/* Button Spinner */
.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-spinner.hidden {
    display: none;
}

/* Preview Area */
.preview-area {
    background: var(--surface-color);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 122, 255, 0.06);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.preview-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #34C759, #30D158);
}

.preview-area:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.preview-container {
    padding: 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    align-self: stretch;
}

.preview-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.preview-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Compact buttons for preview actions */
.preview-actions .primary-button,
.preview-actions .secondary-button {
    padding: 10px 20px;
    font-size: 13px;
    border-radius: 8px;
    min-width: auto;
    white-space: nowrap;
}

/* Published button state */
.preview-actions .primary-button[disabled] {
    background: linear-gradient(135deg, #34C759, #30D158);
    opacity: 1;
    cursor: default;
}

/* View on X link button */
.published-url a {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.3);
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
    font-weight: 500;
}

/* View on X button in preview actions */
.view-on-x-btn {
    background: rgba(52, 199, 89, 0.1) !important;
    border: 2px solid rgba(52, 199, 89, 0.3) !important;
    color: var(--success-color, #34C759) !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.view-on-x-btn:hover {
    background: rgba(52, 199, 89, 0.2) !important;
    border-color: rgba(52, 199, 89, 0.5) !important;
    color: var(--success-color, #34C759) !important;
    text-decoration: none;
    transform: translateY(-2px);
}

/* X Post Preview */
.x-post-preview {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    background: var(--surface-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
    width: 100%;
    max-width: 500px;
}

.x-post-preview:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.username {
    font-weight: 600;
    font-size: 14px;
}

.timestamp {
    color: var(--text-secondary);
    font-size: 12px;
}

.post-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.post-image {
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-stats {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.stat {
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.stat:hover {
    color: var(--primary-color);
}

/* YouTube Short Preview */
.youtube-short-preview {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.video-container {
    aspect-ratio: 9/16;
    max-width: 320px;
    width: 100%;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #000, #1a1a1a);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
}

.video-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 122, 255, 0.1), rgba(88, 86, 214, 0.1));
    pointer-events: none;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 400px;
    background: rgba(0, 122, 255, 0.02);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(0, 122, 255, 0.08);
}

/* Preview Placeholder */
.preview-placeholder {
    padding: 64px 32px;
    text-align: center;
    color: var(--text-secondary);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.02), rgba(88, 86, 214, 0.02));
    border-radius: 16px;
    border: 2px dashed rgba(0, 122, 255, 0.15);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    margin: 0;
}

.preview-placeholder:hover {
    border-color: rgba(0, 122, 255, 0.25);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.04), rgba(88, 86, 214, 0.04));
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.8;
    transform: scale(1);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(0, 122, 255, 0.08);
    border-radius: 16px;
    margin: 0 auto 24px auto;
}

.placeholder-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    filter: grayscale(20%) opacity(0.9);
    transition: var(--transition);
}

.preview-placeholder:hover .placeholder-icon {
    transform: scale(1.05);
    opacity: 1;
    background: rgba(0, 122, 255, 0.12);
}

.preview-placeholder:hover .placeholder-logo {
    filter: grayscale(0%) opacity(1) brightness(1.1);
    transform: scale(1.05);
}

.preview-placeholder h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.preview-placeholder p {
    font-size: 15px;
    line-height: 1.5;
    max-width: 300px;
    margin: 0 auto;
}

/* History Section */
.history-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 122, 255, 0.1), transparent);
    transition: left 0.5s;
}

.filter-btn:hover {
    background: rgba(0, 122, 255, 0.05);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.15);
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 28px;
    margin-top: 32px;
}

/* Empty State */
.no-history {
    grid-column: 1 / -1;
}

.empty-state {
    text-align: center;
    padding: 80px 40px;
    background: linear-gradient(135deg, var(--surface-color), rgba(247, 250, 255, 0.8));
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.empty-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--warning-color), #FF6B35);
}

.empty-icon {
    font-size: 72px;
    margin-bottom: 32px;
    opacity: 0.8;
    transform: scale(1);
    transition: var(--transition);
}

.empty-state:hover .empty-icon {
    transform: scale(1.1);
    opacity: 1;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cta-buttons .primary-button,
.cta-buttons .secondary-button {
    min-width: 140px;
}

/* Published State Styling */
.published-url {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.3);
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.published-url a {
    color: var(--success-color, #34C759);
    text-decoration: none;
    font-weight: 500;
}

.published-url a:hover {
    text-decoration: underline;
}

/* Loading and Success States for Buttons */
.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.primary-button.loading {
    position: relative;
    color: transparent;
}

.primary-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-generator {
        grid-template-columns: 1fr;
    }
    
    .sidebar-nav {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .dashboard-content {
        flex-direction: column;
    }
    
    .sidebar-nav {
        width: 100%;
        padding: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        background: transparent;
        position: relative;
        top: auto;
        z-index: auto;
        margin-top: 0;
    }
    
    /* Mobile Navigation Indicators */
    .mobile-nav-indicators {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 12px 20px 8px;
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(5px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .nav-dots {
        display: flex;
        gap: 8px;
        align-items: center;
    }
    
    .nav-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(0, 122, 255, 0.3);
        transition: all 0.3s ease;
        cursor: pointer;
    }
    
    .nav-dot.active {
        background: var(--primary-color);
        transform: scale(1.2);
        box-shadow: 0 0 8px rgba(0, 122, 255, 0.4);
    }
    
    .nav-dot:hover {
        background: rgba(0, 122, 255, 0.5);
        transform: scale(1.1);
    }
    
    /* Swipe Gesture Visual Feedback */
    .nav-tabs.swiping {
        cursor: grabbing;
    }
    
    .nav-tab-btn {
        transition: all 0.2s ease, transform 0.1s ease;
    }
    
    .nav-tab-btn:active {
        transform: scale(0.98);
    }
    
    /* Swipe direction indicators */
    .nav-tabs::before,
    .nav-tabs::after {
        content: '';
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 20px;
        background: rgba(0, 122, 255, 0.1);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        color: var(--primary-color);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        z-index: 10;
    }
    
    .nav-tabs::before {
        left: 8px;
        content: '‹';
    }
    
    .nav-tabs::after {
        right: 8px;
        content: '›';
    }
    
    .nav-tabs.show-swipe-hints::before,
    .nav-tabs.show-swipe-hints::after {
        opacity: 0.6;
    }
    
    .nav-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding: 16px 20px;
        gap: 12px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-behavior: smooth;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
        backdrop-filter: blur(10px);
        border-radius: 0 0 16px 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        margin: 0 16px;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-top: none;
        position: relative;
        z-index: 50;
    }
    
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    
    /* Smooth scroll indicator */
    .nav-tabs::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg, transparent, rgba(0, 122, 255, 0.3), transparent);
        border-radius: 1px;
    }
    
    .nav-tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
        min-width: 120px;
        padding: 16px 20px;
        font-size: 15px;
        font-weight: 600;
        border-radius: 12px;
        justify-content: center;
        text-align: center;
        min-height: 56px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        border: 1px solid rgba(0, 122, 255, 0.15);
        transition: all 0.2s ease;
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(5px);
    }
    
    .nav-tab-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 122, 255, 0.15);
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(0, 122, 255, 0.25);
    }
    
    .nav-tab-btn.active {
        min-width: 130px;
        transform: none;
        background: linear-gradient(135deg, var(--primary-color), #0056b3);
        color: white;
        border-color: var(--primary-color);
        box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
    }
    
    .nav-tab-btn::after {
        display: none;
    }
    
    /* Touch device improvements */
    .nav-tab-btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .nav-tab-text {
        font-size: 14px;
        font-weight: 600;
    }
    
    .nav-logo {
        width: 20px;
        height: 20px;
    }
    
    .main-content-area {
        padding: 20px 16px;
        margin-top: 16px;
    }
    
    .preview-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .preview-actions .primary-button,
    .preview-actions .secondary-button {
        width: 100%;
        min-height: 48px;
        font-size: 15px;
        padding: 14px 20px;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .cta-buttons .primary-button,
    .cta-buttons .secondary-button {
        width: 100%;
        max-width: 280px;
        min-height: 48px;
    }
    
    /* Content Generator Mobile Optimization */
    .content-generator {
        gap: 24px;
        margin-bottom: 40px;
    }
    
    .input-area {
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .form-field {
        margin-bottom: 16px;
    }
    
    .form-field label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-field textarea,
    .form-field input[type="text"],
    .form-field select {
        padding: 14px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 10px;
        min-height: 48px; /* Better touch target */
    }
    
    .generation-options {
        padding: 16px;
        gap: 12px;
        margin-bottom: 24px;
    }
    
    .option-group {
        gap: 10px;
    }
    
    .option-group label {
        font-size: 14px;
    }
    
    .checkbox-custom {
        width: 20px;
        height: 20px;
        min-width: 20px;
    }
    
    .section-header {
        margin-bottom: 32px;
        padding-bottom: 24px;
    }
    
    .section-header h2 {
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .section-description {
        font-size: 16px;
    }
    
    .input-hint {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* Preview Area Mobile Optimization */
    .preview-area {
        border-radius: 16px;
        margin-bottom: 24px;
    }
    
    .preview-container {
        padding: 24px 20px;
    }
    
    .preview-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-bottom: 24px;
        padding-bottom: 20px;
    }
    
    .preview-header h3 {
        font-size: 18px;
        text-align: center;
        margin: 0;
    }
    
    .preview-actions {
        justify-content: center;
        gap: 12px;
    }
    
    .preview-actions .primary-button,
    .preview-actions .secondary-button {
        width: 100%;
        min-height: 48px;
        font-size: 15px;
        padding: 14px 20px;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .cta-buttons .primary-button,
    .cta-buttons .secondary-button {
        width: 100%;
        max-width: 280px;
        min-height: 48px;
    }
}

/* Extra small mobile screens */
@media (max-width: 480px) {
    .nav-tabs {
        padding: 0 16px;
        gap: 10px;
        margin: 0 12px;
        border-radius: 0 0 14px 14px;
    }
    
    .nav-tab-btn {
        min-width: 100px;
        padding: 14px 16px;
        font-size: 14px;
        min-height: 52px;
    }
    
    .nav-tab-btn.active {
        min-width: 110px;
    }
    
    .nav-tab-text {
        font-size: 13px;
    }
    
    .nav-logo {
        width: 18px;
        height: 18px;
    }
    
    .main-content-area {
        padding: 16px 12px;
        margin-top: 12px;
    }
    
    /* Extra Small Screen Navigation Indicators */
    .mobile-nav-indicators {
        padding: 10px 16px 6px;
        gap: 6px;
    }
    
    .nav-dots {
        gap: 6px;
    }
    
    .nav-dot {
        width: 6px;
        height: 6px;
    }
    
    /* Content Generator Extra Small Screen Optimization */
    .content-generator {
        gap: 20px;
        margin-bottom: 32px;
    }
    
    .input-area {
        padding: 20px 16px;
        border-radius: 14px;
    }
    
    .form-field textarea,
    .form-field input[type="text"],
    .form-field select {
        padding: 12px;
        font-size: 16px;
        min-height: 44px;
    }
    
    .generation-options {
        padding: 14px;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .section-header h2 {
        font-size: 22px;
    }
    
    .section-description {
        font-size: 15px;
    }
    
    /* Preview Area Extra Small Screen Optimization */
    .preview-container {
        padding: 20px 16px;
    }
    
    .preview-header {
        gap: 12px;
        margin-bottom: 20px;
        padding-bottom: 16px;
    }
    
    .preview-header h3 {
        font-size: 16px;
    }
    
    .preview-actions {
        gap: 10px;
    }
    
    .preview-actions .primary-button,
    .preview-actions .secondary-button {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
    }
    
    .x-post-preview {
        padding: 14px;
        border-radius: 10px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .username {
        font-size: 12px;
    }
    
    .timestamp {
        font-size: 10px;
    }
    
    .post-text {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .post-stats {
        gap: 16px;
    }
    
    .stat {
        font-size: 10px;
        min-height: 40px;
    }
    
    .video-container {
        max-width: 260px;
        border-radius: 10px;
    }
    
    .preview-placeholder {
        padding: 24px 16px;
    }
    
    .preview-placeholder h3 {
        font-size: 16px;
    }
    
    .preview-placeholder p {
        font-size: 13px;
    }
}

/* Touch Device Improvements for Form Controls */
@media (hover: none) and (pointer: coarse) {
    .form-field textarea,
    .form-field input[type="text"],
    .form-field select {
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    
    .form-field textarea:active,
    .form-field input[type="text"]:active,
    .form-field select:active {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
    }
    
    .checkbox-custom {
        transition: all 0.15s ease;
    }
    
    .checkbox-custom:active {
        transform: scale(0.95);
        background: rgba(0, 122, 255, 0.1);
    }
    
    .option-group label {
        transition: color 0.15s ease;
    }
    
    .option-group label:active {
        color: var(--primary-color);
    }
    
    .input-hint {
        transition: background-color 0.2s ease;
    }
    
    .input-hint:active {
        background: rgba(0, 122, 255, 0.08);
    }
}

/* Veo 3 Specific Styling */
.veo3-options {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 16px;
    animation: fadeIn 0.3s ease-in-out;
}

.veo3-info {
    margin-top: 12px;
}

.info-badge {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.info-badge span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* Provider selection styling */
#video-provider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 500;
}

#video-provider option {
    background: white;
    color: var(--text-color);
    padding: 8px;
}

/* Animation for provider switch */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Seedance specific options styling */
.seedance-options {
    animation: fadeIn 0.3s ease-in-out;
}

/* Negative prompt specific styling - override option-group flex layout */
.veo3-options .negative-prompt-group.option-group {
    display: block;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-bottom: 20px;
}

.veo3-options .negative-prompt-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}

.veo3-options .optional-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: normal;
    font-style: italic;
}

.veo3-options .negative-prompt-group textarea {
    resize: vertical;
    font-family: inherit;
    line-height: 1.4;
    width: 100%;
    box-sizing: border-box;
}

.veo3-options .negative-prompt-group .input-hint-container {
    display: block;
    width: 100%;
    margin-top: 4px;
}

.veo3-options .negative-prompt-group .tip-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: #f0f0f5;
    border: 1px solid #e0e0e8;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    box-sizing: border-box;
    margin-top: 4px;
}

.veo3-options .negative-prompt-group .tip-text {
    flex: 1;
    margin-right: 12px;
}

.char-count {
    font-weight: 500;
    font-family: monospace;
    white-space: nowrap;
    font-size: 11px;
    opacity: 0.8;
}

/* Video preview aspect ratio fix for 16:9 */
.video-preview-container {
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.video-preview-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* History Items Styling */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 16px;
    grid-column: 1 / -1;
}

.history-item {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    animation: fadeInUp 0.4s ease-out;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.history-item-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.history-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
}

.history-item-date {
    color: var(--text-secondary);
    font-size: 14px;
}

.history-item-content {
    margin-bottom: 16px;
}

.history-post-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.history-post-image {
    border-radius: 8px;
    overflow: hidden;
    max-width: 300px;
}

.history-post-image img {
    width: 100%;
    height: auto;
    display: block;
}

.history-video-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.history-video-preview {
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 320px;
    aspect-ratio: 16/9;
}

.history-video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Generated Video specific styling */
.generated-video-item .provider-icon {
    font-size: 20px;
    margin-right: 8px;
}

.history-video-service {
    margin-top: 8px;
}

.service-badge {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.publish-youtube-btn {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    min-width: auto;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.publish-youtube-btn:hover {
    background: rgba(255, 59, 48, 0.2);
    border-color: rgba(255, 59, 48, 0.3);
}

/* Modal styling - removed duplicate rules that conflict with X API modal */

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.history-video-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.history-video-tags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.history-video-tags .tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
}

.history-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.history-item-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.status-generated {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
}

.status-published {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success-color, #34C759);
}

.status-draft {
    background: rgba(255, 149, 0, 0.1);
    color: var(--warning-color, #ff9500);
}

.history-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.view-published-btn {
    color: var(--success-color, #34C759);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(52, 199, 89, 0.1);
    transition: var(--transition);
}

.view-published-btn:hover {
    background: rgba(52, 199, 89, 0.2);
    text-decoration: none;
}

.republish-btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 8px;
    min-width: auto;
}

/* X Post specific styling */
.x-post-item {
    border-left: 4px solid #1DA1F2;
}

/* YouTube specific styling */
.youtube-item {
    border-left: 4px solid #FF0000;
}

.youtube-video-item {
    border-left: 4px solid #FF0000;
}

.history-video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.history-video-tags .tag {
    background: rgba(255, 0, 0, 0.1);
    color: #FF0000;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.view-on-youtube-btn {
    background: #4CAF50 !important;
    color: white !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-on-youtube-btn:hover {
    background: #45a049 !important;
    transform: translateY(-1px);
}

/* YouTube Connection Section */
.youtube-connection-section {
    margin-bottom: 24px;
}

/* X Connection Section */
.x-connection-section {
    margin-bottom: 24px;
}

.connection-status-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.connection-status-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.connection-details h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.connection-details p {
    margin: 2px 0 0 0;
    font-size: 14px;
    color: #666;
}

.connection-btn {
    background: #ff0000;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.connection-btn:hover {
    background: #cc0000;
    transform: translateY(-1px);
}

.connection-btn:disabled {
    background: #4CAF50;
    cursor: not-allowed;
    transform: none;
}

.connection-btn:disabled:hover {
    background: #4CAF50;
    transform: none;
}

/* Connection status colors */
#youtube-connection-status {
    transition: color 0.2s ease;
}

.connection-status-connected {
    border-color: #4CAF50 !important;
    background: linear-gradient(135deg, #fff, #f8fff9) !important;
}

.connection-status-connected #youtube-connection-status {
    color: #4CAF50;
}

.connection-status-error {
    border-color: #f44336 !important;
    background: linear-gradient(135deg, #fff, #fff5f5) !important;
}

.connection-status-error #youtube-connection-status {
    color: #f44336;
}

/* X Connection Status */
#x-connection-status {
    transition: color 0.2s ease;
}

.connection-status-connected #x-connection-status {
    color: #4CAF50;
}

.connection-status-error #x-connection-status {
    color: #f44336;
}

/* Responsive design */
@media (max-width: 768px) {
    .connection-status-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .connection-info {
        justify-content: center;
    }
    
    .connection-btn {
        width: 100%;
    }
}

/* Responsive history items */
@media (max-width: 768px) {
    .history-item {
        padding: 20px;
    }
    
    .history-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .history-item-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .history-video-preview,
    .history-post-image {
        max-width: 100%;
    }
}

/* X Post Editing Styles */
.post-text-editor {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    background: var(--surface-color);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.post-text-editor:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.edit-controls {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}

.edit-controls .primary-button,
.edit-controls .secondary-button {
    font-size: 13px;
    padding: 8px 16px;
    min-width: auto;
}

/* YouTube Publishing Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #1e293b;
}

.modal-body {
    padding: 0 24px 24px 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.form-actions .secondary-button,
.form-actions .primary-button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 100px;
}

.form-actions .secondary-button {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.form-actions .secondary-button:hover {
    background: #f1f5f9;
    color: #475569;
}

.form-actions .primary-button {
    background: #007AFF;
    color: white;
}

.form-actions .primary-button:hover {
    background: #0056b3;
}

.input-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.4;
    font-style: italic;
}

/* X Post Scheduling UI */
.publish-options {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.publish-mode-select {
    background: rgba(0, 122, 255, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
}

.publish-mode-select:hover,
.publish-mode-select:focus {
    border-color: rgba(0, 122, 255, 0.4);
    background: rgba(0, 122, 255, 0.12);
}

.schedule-datetime-container {
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease-out;
}

.schedule-datetime-container.hidden {
    display: none;
}

.datetime-input {
    background: rgba(0, 122, 255, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
    min-width: 200px;
}

.datetime-input:hover,
.datetime-input:focus {
    border-color: rgba(0, 122, 255, 0.4);
    background: rgba(0, 122, 255, 0.12);
}

/* Update publish button to handle both modes */
#publish-x-post {
    min-width: 120px;
    transition: var(--transition);
}

#publish-x-post.schedule-mode {
    background: linear-gradient(135deg, #FF6B35, #F7931E);
}

#publish-x-post.schedule-mode:hover {
    background: linear-gradient(135deg, #E55A2B, #E8841A);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 101, 37, 0.25);
}

/* Responsive adjustments for scheduling UI */
@media (max-width: 768px) {
    .publish-options {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .publish-mode-select,
    .datetime-input {
        width: 100%;
    }
    
    .schedule-datetime-container {
        width: 100%;
    }
    
    #publish-x-post {
        width: 100%;
    }
}

/* Animation for schedule dropdown */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scheduled Posts Management View */
.scheduled-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.stat-card {
    background: rgba(0, 122, 255, 0.05);
    border: 1px solid rgba(0, 122, 255, 0.12);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    background: rgba(0, 122, 255, 0.08);
    border-color: rgba(0, 122, 255, 0.2);
}

.stat-number {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.scheduled-posts-container {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(0, 122, 255, 0.08);
}

.scheduled-posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.scheduled-posts-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.refresh-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

#refresh-scheduled-posts:hover .refresh-icon {
    transform: rotate(180deg);
}

.scheduled-posts-list {
    min-height: 200px;
}

.scheduled-posts-placeholder {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.scheduled-posts-placeholder .placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.scheduled-posts-placeholder h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.scheduled-posts-placeholder p {
    margin: 0;
    max-width: 400px;
    margin: 0 auto;
}

.scheduled-post-item {
    background: rgba(0, 122, 255, 0.03);
    border: 1px solid rgba(0, 122, 255, 0.12);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.scheduled-post-item:hover {
    background: rgba(0, 122, 255, 0.06);
    border-color: rgba(0, 122, 255, 0.2);
}

.scheduled-post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.scheduled-post-info {
    flex: 1;
}

.scheduled-post-time {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.scheduled-post-relative-time {
    font-size: 14px;
    color: var(--text-secondary);
}

.scheduled-post-status {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scheduled-post-status.scheduled {
    background: rgba(255, 193, 7, 0.15);
    color: #F57C00;
}

.scheduled-post-status.published {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.scheduled-post-status.failed {
    background: rgba(244, 67, 54, 0.15);
    color: #F44336;
}

.scheduled-post-status.publishing {
    background: rgba(33, 150, 243, 0.15);
    color: #2196F3;
}

.scheduled-post-content {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.5);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(0, 122, 255, 0.08);
}

.scheduled-post-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.scheduled-post-actions button {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.scheduled-post-actions .edit-btn {
    background: rgba(255, 193, 7, 0.1);
    color: #F57C00;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.scheduled-post-actions .edit-btn:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.5);
}

.scheduled-post-actions .cancel-btn {
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.scheduled-post-actions .cancel-btn:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.5);
}

.scheduled-post-actions .publish-now-btn {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.scheduled-post-actions .publish-now-btn:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
}

.load-more-container {
    text-align: center;
    margin-top: 24px;
}

/* Responsive adjustments for scheduled posts */
@media (max-width: 768px) {
    .scheduled-stats {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .scheduled-post-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .scheduled-post-actions {
        justify-content: stretch;
    }
    
    .scheduled-post-actions button {
        flex: 1;
        min-width: 0;
    }
}