/**
 * Profile Page Styles
 * RTL layout for Hebrew interface
 * All classes prefixed with nvm- for namespace safety in WordPress/Elementor
 */

/* =========================================================================
   Profile Page Container
   ========================================================================= */

.nvm-profile-page-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Heebo', 'Segoe UI', sans-serif;
}

.nvm-profile-page-header {
    text-align: center;
    margin-bottom: 30px;
}

.nvm-profile-page-header h1 {
    font-size: 28px;
    color: #1a1a2e;
    margin-bottom: 5px;
}

.nvm-profile-page-header p {
    font-size: 16px;
    color: #666;
}

/* =========================================================================
   Login Container
   ========================================================================= */

.nvm-profile-login-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.nvm-profile-login-header {
    text-align: center;
    margin-bottom: 20px;
}

.nvm-profile-login-header h1 {
    font-size: 28px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.nvm-profile-login-header p {
    font-size: 16px;
    color: #666;
}

/* =========================================================================
   Tab Navigation
   ========================================================================= */

.nvm-profile-tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 25px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nvm-profile-tab-btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #555;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    text-align: center;
    flex-shrink: 0;
}

.nvm-profile-tab-btn:hover {
    color: #0073aa;
    background: rgba(0, 115, 170, 0.05);
}

.nvm-profile-tab-btn.nvm-profile-tab-active {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

/* =========================================================================
   Tab Panels
   ========================================================================= */

.nvm-profile-tab-panel {
    display: none;
    animation: nvmProfileFadeIn 0.3s ease-in;
}

.nvm-profile-tab-panel.nvm-profile-panel-active {
    display: block;
}

@keyframes nvmProfileFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading Spinner */
.nvm-profile-tab-loading {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.nvm-profile-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: nvmProfileSpin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes nvmProfileSpin {
    to { transform: rotate(360deg); }
}

.nvm-profile-error {
    text-align: center;
    padding: 40px;
    color: #c00;
}

/* =========================================================================
   My Details Card
   ========================================================================= */

.nvm-profile-details-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 30px;
}

/* Status Notices */
.nvm-profile-status-notice {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.nvm-profile-status-notice h4 {
    margin: 0 0 5px 0;
    font-size: 15px;
}

.nvm-profile-status-notice p {
    margin: 0;
    font-size: 14px;
}

.nvm-profile-status-pending {
    background: #fff8e1;
    border: 1px solid #ffc107;
    color: #856404;
}

.nvm-profile-status-approved {
    background: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.nvm-profile-status-rejected {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
}

/* Header Section */
.nvm-profile-details-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.nvm-profile-details-photo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e0e0e0;
}

.nvm-profile-details-photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #ccc;
}

.nvm-profile-details-name h2 {
    font-size: 24px;
    color: #1a1a2e;
    margin: 0 0 5px 0;
}

.nvm-profile-subtitle {
    color: #666;
    font-size: 15px;
    margin: 0 0 8px 0;
}

.nvm-profile-view-public-link {
    color: #0073aa;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nvm-profile-view-public-link:hover {
    text-decoration: underline;
}

/* Details Grid */
.nvm-profile-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.nvm-profile-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.nvm-profile-detail-icon {
    color: #0073aa;
    font-size: 16px;
    min-width: 24px;
    text-align: center;
    margin-top: 2px;
}

.nvm-profile-detail-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 2px;
}

.nvm-profile-detail-value {
    display: block;
    font-size: 14px;
    color: #333;
    word-break: break-word;
}

a.nvm-profile-detail-value {
    color: #0073aa;
    text-decoration: none;
}

a.nvm-profile-detail-value:hover {
    text-decoration: underline;
}

/* Detail Sections */
.nvm-profile-details-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.nvm-profile-details-section h3 {
    font-size: 16px;
    color: #1a1a2e;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nvm-profile-details-section h3 i {
    color: #0073aa;
}

.nvm-profile-details-text {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
}

/* Pricing Table */
.nvm-pricing-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nvm-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border-radius: 6px;
}

.nvm-pricing-service-name {
    font-size: 14px;
    color: #333;
}

.nvm-pricing-amount {
    font-size: 15px;
    font-weight: 700;
    color: #0073aa;
}

/* Actions */
.nvm-profile-details-actions {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: white;
}

.nvm-profile-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nvm-profile-no-data {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.nvm-profile-no-data a {
    color: #0073aa;
    text-decoration: underline;
}

/* =========================================================================
   Feature Intro Text
   ========================================================================= */

.nvm-profile-tab-title {
    font-size: 24px;
    color: #1a1a2e;
    font-weight: 700;
    margin-bottom: 15px;
    margin-top: 0;
}

.nvm-profile-intro-text {
    font-family: 'Heebo', 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #4a4a4a;
    background-color: #fcfcfc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-right: 4px solid #ce7929;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.nvm-profile-intro-text strong {
    color: #1a1a2e;
    font-weight: 600;
}

/* =========================================================================
   Articles
   ========================================================================= */

.nvm-articles-page-container {
    max-width: 100%;
}

.nvm-article-form-section {
    margin-bottom: 30px;
}

.nvm-article-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.nvm-article-form-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1a1a2e;
}

.nvm-article-form-hidden {
    display: none !important;
}

#article-form {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-top: 10px;
}

#article-form .nvm-profile-form-group {
    margin-bottom: 18px;
}

#article-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

#article-form input[type="text"],
#article-form input[type="url"],
#article-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#article-form input:focus,
#article-form textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

#article-form small {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

#article-form textarea {
    resize: vertical;
    min-height: 150px;
}

.nvm-profile-required-asterisk {
    color: #c00;
}

/* Article messages */
.nvm-article-message {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.nvm-article-msg-success {
    background: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.nvm-article-msg-error {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
}

/* Article List */
.nvm-articles-list-section h2 {
    font-size: 20px;
    color: #1a1a2e;
    margin-bottom: 15px;
}

.nvm-articles-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    background: #f8f9fa;
    border-radius: 10px;
}

.nvm-articles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nvm-article-list-item {
    display: flex;
    gap: 15px;
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    align-items: center;
    transition: box-shadow 0.2s;
}

.nvm-article-list-item:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.nvm-article-list-thumb-wrap {
    flex-shrink: 0;
}

.nvm-article-list-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.nvm-article-list-thumb-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ccc;
}

.nvm-article-list-content {
    flex: 1;
    min-width: 0;
}

.nvm-article-list-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nvm-article-list-header h3 {
    font-size: 16px;
    margin: 0;
    color: #1a1a2e;
}

.nvm-article-list-subtitle {
    font-size: 13px;
    color: #888;
    margin: 3px 0 0 0;
}

.nvm-article-list-date {
    font-size: 12px;
    color: #aaa;
    margin: 3px 0 0 0;
}

/* Status Badges */
.nvm-article-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.nvm-article-status-published {
    background: #e8f5e9;
    color: #2e7d32;
}

.nvm-article-status-draft {
    background: #fff8e1;
    color: #f57f17;
}

.nvm-article-status-pending {
    background: #e3f2fd;
    color: #1565c0;
}

/* Article Actions */
.nvm-article-list-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* =========================================================================
   Shared Buttons
   ========================================================================= */

.nvm-profile-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: #ce7929;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    text-decoration: none;
}

.nvm-profile-btn-primary:hover {
    background: #ce7929d9;
}

.nvm-profile-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: #f0f0f0;
    color: #555;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    text-decoration: none;
}

.nvm-profile-btn-secondary:hover {
    background: #e0e0e0;
}

.nvm-profile-btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #555;
    transition: all 0.15s;
    text-decoration: none;
    font-family: inherit;
}

.nvm-profile-btn-small:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.nvm-profile-btn-danger {
    color: #c00;
    border-color: #fcc;
}

.nvm-profile-btn-danger:hover {
    background: #fff5f5;
    border-color: #c00;
}

.nvm-profile-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 768px) {
    .nvm-profile-page-container {
        padding: 15px;
    }

    .nvm-profile-tabs-nav {
        gap: 0;
    }

    .nvm-profile-tab-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .nvm-profile-details-header {
        flex-direction: column;
        text-align: center;
    }

    .nvm-profile-details-grid {
        grid-template-columns: 1fr;
    }

    .nvm-article-list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .nvm-article-list-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .nvm-article-form-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .nvm-profile-form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .nvm-profile-page-header h1 {
        font-size: 22px;
    }

    .nvm-profile-tab-btn {
        padding: 8px 10px;
        font-size: 12px;
    }

    .nvm-profile-details-card {
        padding: 20px;
    }
}

/* =========================================================================
   Modal
   ========================================================================= */

.nvm-profile-modal {
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nvm-profile-modal-content {
    background-color: #fdfdfd;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 900px;
    border-radius: 12px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.nvm-profile-modal-close {
    color: #666;
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

.nvm-profile-modal-close:hover,
.nvm-profile-modal-close:focus {
    color: #000;
    text-decoration: none;
}

/* =========================================================================
   Image Dropzone
   ========================================================================= */

.nvm-article-image-dropzone {
    border: 2px dashed #0073aa;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    background: #fdfdfd;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nvm-article-image-dropzone:hover,
.nvm-article-image-dropzone.is-dragover {
    background: #f0f8ff;
    border-color: #005a87;
}

.nvm-article-image-input {
    display: none;
}

.nvm-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #0073aa;
}

.nvm-dropzone-content i {
    font-size: 36px;
}

.nvm-dropzone-content span {
    font-size: 16px;
    font-weight: 500;
}

.nvm-dropzone-preview {
    display: none;
    margin-top: 15px;
}

.nvm-dropzone-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nvm-article-image-dropzone.has-image .nvm-dropzone-content {
    display: none;
}

/* =========================================================================
   Select2 Tags Input Overrides
   ========================================================================= */

.nvm-profile-form-group .select2-container--default .select2-selection--multiple {
    min-height: 48px;
    height: auto !important;
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid #ddd;
    display: flex; /* Back to flex */
    align-items: center;
    width: 100%;
}

.nvm-profile-form-group .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap; /* Important for multiple lines */
    align-items: center;
    gap: 8px;
    width: 100%;
}

.nvm-profile-form-group .select2-container .select2-search--inline {
    flex-grow: 1; /* Allow it to take up remaining space inline */
    margin-top: 0;
    float: none;
}

.nvm-profile-form-group .select2-container .select2-search--inline .select2-search__field {
    min-width: 150px;
    width: auto !important; /* Let select2 handle width */
    margin-top: 5px !important;
    padding: 0 5px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 16px;
    height: 32px !important;
    line-height: 32px !important;
    min-height: 32px !important;
}

.nvm-profile-form-group .select2-container--default .select2-selection--multiple .select2-selection__choice {
    float: none;
    margin-top: 6px !important;
    margin-left: 6px !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    padding: 4px 10px;
    background-color: #f0f8ff;
    border: 1px solid #0073aa;
    color: #0073aa;
    border-radius: 20px;
    display: flex;
    align-items: center;
    direction: rtl; /* RTL */
}

.nvm-profile-form-group .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    margin-right: 5px;
    margin-left: 0;
    color: #0073aa;
    border-left: 1px solid #0073aa;
    border-right: none;
    padding-left: 5px;
    font-weight: bold;
}

.nvm-profile-form-group .select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    padding-left: 5px;
    direction: rtl;
}
