/*
 * Premium CSS Stylesheet for the WP AI Job Importer Front-end Submission Form
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

.ai-frontend-wrapper {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 960px;
    margin: 40px auto;
    color: #1e293b;
    line-height: 1.5;
}

/* Premium Header Card */
.ai-frontend-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #ffffff;
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.3);
    position: relative;
    overflow: hidden;
}

.ai-frontend-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.ai-frontend-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.ai-frontend-header p {
    font-size: 16px;
    margin: 0;
    opacity: 0.85;
    font-weight: 400;
}

/* Glassmorphism Forms and Cards */
.ai-frontend-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Mode Selectors */
.ai-frontend-mode-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.ai-frontend-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: #475569;
    transition: all 0.2s ease;
}

.ai-frontend-mode-btn.active {
    border-color: #6366f1;
    background: #e0e7ff;
    color: #4f46e5;
}

.ai-frontend-mode-btn:hover:not(.active) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

/* Styled Inputs */
.ai-frontend-group {
    margin-bottom: 25px;
}

.ai-frontend-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #334155;
    margin-bottom: 8px;
}

.ai-frontend-input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    background: #f8fafc;
    color: #1e293b;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.ai-frontend-input:focus {
    outline: none;
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

/* Custom Multi-select Dropdown styling */
.ai-multiselect {
    position: relative;
    width: 100%;
}

.ai-multiselect-trigger {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    background: #f8fafc;
    color: #1e293b;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    transition: all 0.2s ease;
    user-select: none;
}

.ai-multiselect-trigger:hover {
    border-color: #94a3b8;
}

.ai-multiselect.open .ai-multiselect-trigger {
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.ai-multiselect-placeholder {
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

.ai-multiselect-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #64748b;
    transition: transform 0.2s ease;
}

.ai-multiselect.open .ai-multiselect-arrow {
    transform: rotate(180deg);
}

.ai-multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-top: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    padding: 8px 0;
    animation: ai-fadeIn 0.2s ease;
}

.ai-multiselect-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    margin: 0 !important;
    font-size: 14px;
    color: #334155;
    font-weight: 500;
}

.ai-multiselect-option:hover {
    background: #f1f5f9;
}

.ai-multiselect-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    accent-color: #6366f1;
    margin: 0 !important;
}

/* Selected tags inside trigger */
.ai-multiselect-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 90%;
}

.ai-multiselect-tag {
    background: #e0e7ff;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

/* WYSIWYG Editor Styling */
.ai-wysiwyg-editor {
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ai-wysiwyg-toolbar {
    background: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.ai-wysiwyg-btn {
    border: 1px solid transparent;
    background: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.15s ease;
    padding: 0 !important;
}

.ai-wysiwyg-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ai-wysiwyg-btn:active {
    background: #cbd5e1;
}

.ai-wysiwyg-separator {
    width: 1px;
    height: 20px;
    background: #cbd5e1;
    margin: 0 4px;
}

.ai-wysiwyg-editor-area {
    padding: 16px 20px;
    min-height: 250px;
    max-height: 500px;
    overflow-y: auto;
    outline: none;
    font-size: 15px;
    line-height: 1.7;
    color: #334155;
    background: #ffffff;
}

.ai-wysiwyg-editor-area p {
    margin-top: 0;
    margin-bottom: 1rem;
}

.ai-wysiwyg-editor-area h2, .ai-wysiwyg-editor-area h3 {
    color: #0f172a;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.ai-wysiwyg-editor-area h2 { font-size: 20px; }
.ai-wysiwyg-editor-area h3 { font-size: 18px; }

.ai-wysiwyg-editor-area ul, .ai-wysiwyg-editor-area ol {
    margin-left: 20px;
    margin-bottom: 1rem;
}

.ai-wysiwyg-editor-area li {
    margin-bottom: 0.5rem;
}

/* File Drop Zone */
.ai-frontend-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ai-frontend-dropzone:hover, .ai-frontend-dropzone.dragover {
    border-color: #6366f1;
    background: #f5f3ff;
}

.ai-frontend-dropzone svg {
    width: 48px;
    height: 48px;
    color: #6366f1;
    transition: transform 0.2s ease;
}

.ai-frontend-dropzone:hover svg {
    transform: translateY(-4px);
}

.ai-frontend-dropzone span {
    font-size: 15px;
    font-weight: 500;
    color: #475569;
}

.ai-frontend-dropzone-info {
    font-size: 12px;
    color: #94a3b8;
}

/* Buttons */
.ai-frontend-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.ai-frontend-btn-primary {
    background: #6366f1;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.ai-frontend-btn-primary:hover {
    background: #4f46e5;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.ai-frontend-btn-primary:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.ai-frontend-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.ai-frontend-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Loading Spinner */
.ai-loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid #ffffff;
    width: 20px;
    height: 20px;
    animation: ai-spin 1s linear infinite;
}

.ai-loading-spinner-dark {
    border-top-color: #6366f1;
    border-color: rgba(99, 102, 241, 0.1);
}

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

/* Tabs for Preview and Edit */
.ai-dashboard-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 30px;
    padding-bottom: 8px;
}

.ai-dashboard-tab {
    padding: 12px 24px;
    font-weight: 600;
    font-size: 15px;
    color: #64748b;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ai-dashboard-tab.active {
    color: #6366f1;
    background: #e0e7ff;
}

.ai-dashboard-tab:hover:not(.active) {
    color: #334155;
    background: #f8fafc;
}

/* Preview Canvas (Stunning Job Details Layout) */
.ai-preview-container {
    animation: ai-fadeIn 0.4s ease;
}

.ai-preview-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.ai-preview-org {
    font-size: 14px;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.ai-preview-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 15px 0;
    letter-spacing: -0.5px;
}

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

.ai-preview-badge {
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
}

.ai-preview-badge-type {
    background: #e0e7ff;
    color: #4f46e5;
}

.ai-preview-badge-loc {
    background: #ecfdf5;
    color: #059669;
}

.ai-preview-badge-fun {
    background: #fff7ed;
    color: #d97706;
}

.ai-preview-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.ai-preview-meta-item {
    display: flex;
    flex-direction: column;
}

.ai-preview-meta-label {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ai-preview-meta-value {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}

.ai-preview-body {
    font-size: 16px;
    color: #334155;
    line-height: 1.8;
}

.ai-preview-body h1, .ai-preview-body h2, .ai-preview-body h3 {
    color: #0f172a;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
}

.ai-preview-body h2 { font-size: 20px; }
.ai-preview-body h3 { font-size: 18px; }

.ai-preview-body ul, .ai-preview-body ol {
    margin-left: 20px;
    margin-bottom: 1rem;
}

.ai-preview-body li {
    margin-bottom: 0.5rem;
}

/* Apply CTA Area */
.ai-preview-apply-area {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
}

.ai-preview-apply-btn {
    background: #10b981;
    color: #ffffff;
    font-weight: 700;
    padding: 14px 35px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.ai-preview-apply-btn:hover {
    background: #059669;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

/* Success Card */
.ai-success-card {
    text-align: center;
    padding: 50px 30px;
    animation: ai-scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-success-icon {
    width: 80px;
    height: 80px;
    background: #ecfdf5;
    color: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px auto;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.1);
}

.ai-success-icon svg {
    width: 40px;
    height: 40px;
}

.ai-success-card h3 {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px 0;
}

.ai-success-card p {
    font-size: 16px;
    color: #64748b;
    margin: 0 auto 35px auto;
    max-width: 500px;
}

/* Transitions */
@keyframes ai-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ai-scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.ai-hide {
    display: none !important;
}

.ai-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media(max-width: 768px) {
    .ai-grid-2 {
        grid-template-columns: 1fr;
    }
}
