/* ============================================================
   Knowtiv Marketplace — Base44-Style Directory CSS
   ============================================================ */

/* ---- Reset & Variables ---- */
.mp-directory,
.mp-submit {
    --mp-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mp-dark: #111827;
    --mp-gray-900: #1f2937;
    --mp-gray-700: #374151;
    --mp-gray-500: #6b7280;
    --mp-gray-400: #9ca3af;
    --mp-gray-300: #d1d5db;
    --mp-gray-200: #e5e7eb;
    --mp-gray-100: #f3f4f6;
    --mp-gray-50: #f9fafb;
    --mp-white: #ffffff;
    --mp-blue: #2563eb;
    --mp-blue-light: #dbeafe;
    --mp-green: #059669;
    --mp-green-light: #d1fae5;
    --mp-red: #dc2626;
    --mp-red-light: #fee2e2;
    --mp-yellow: #d97706;
    --mp-yellow-light: #fef3c7;
    --mp-radius: 12px;
    --mp-radius-sm: 8px;
    --mp-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --mp-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.12);
    --mp-transition: 0.2s ease;

    font-family: var(--mp-font);
    color: var(--mp-dark);
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ---- Page Header ---- */
.mp-header {
    text-align: center;
    margin-bottom: 32px;
}

.mp-header-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--mp-dark);
}

.mp-header-subtitle {
    font-size: 16px;
    color: var(--mp-gray-500);
    margin: 0;
}

/* ---- Filter Bar ---- */
.mp-filters {
    margin-bottom: 28px;
}

.mp-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.mp-filter-group {
    flex: 0 0 auto;
}

.mp-filter-search {
    flex: 1 1 200px;
}

.mp-input,
.mp-select {
    font-family: var(--mp-font);
    font-size: 14px;
    padding: 10px 14px;
    border: 1px solid var(--mp-gray-300);
    border-radius: var(--mp-radius-sm);
    background: var(--mp-white);
    color: var(--mp-dark);
    outline: none;
    transition: border-color var(--mp-transition);
    width: 100%;
    box-sizing: border-box;
}

.mp-input:focus,
.mp-select:focus {
    border-color: var(--mp-blue);
    box-shadow: 0 0 0 3px var(--mp-blue-light);
}

.mp-input-error {
    border-color: var(--mp-red) !important;
    box-shadow: 0 0 0 3px var(--mp-red-light) !important;
}

.mp-btn-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mp-font);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    background: var(--mp-gray-900);
    color: var(--mp-white);
    border: none;
    border-radius: var(--mp-radius-sm);
    cursor: pointer;
    transition: background var(--mp-transition);
    text-decoration: none;
}

.mp-btn-search:hover {
    background: var(--mp-dark);
}

.mp-btn-search svg {
    flex-shrink: 0;
}

/* Active Filters */
.mp-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--mp-gray-50);
    border-radius: var(--mp-radius-sm);
}

.mp-active-filters-label {
    font-size: 13px;
    color: var(--mp-gray-500);
    font-weight: 500;
}

.mp-filter-pill {
    display: inline-block;
    padding: 4px 12px;
    background: var(--mp-blue-light);
    color: var(--mp-blue);
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
}

.mp-clear-filters {
    font-size: 13px;
    color: var(--mp-red);
    text-decoration: none;
    font-weight: 500;
    margin-left: auto;
}

.mp-clear-filters:hover {
    text-decoration: underline;
}

/* ---- Card Grid ---- */
.mp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .mp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .mp-grid {
        grid-template-columns: 1fr;
    }

    .mp-filters-row {
        flex-direction: column;
    }

    .mp-filter-group {
        width: 100%;
    }
}

/* ---- Card ---- */
.mp-card {
    position: relative;
    background: var(--mp-white);
    border: 1px solid var(--mp-gray-200);
    border-radius: var(--mp-radius);
    padding: 24px;
    box-shadow: var(--mp-shadow);
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--mp-transition), transform var(--mp-transition);
}

.mp-card:hover {
    box-shadow: var(--mp-shadow-lg);
    transform: translateY(-2px);
}

.mp-card-featured {
    border-color: var(--mp-yellow);
    box-shadow: 0 0 0 1px var(--mp-yellow), var(--mp-shadow);
}

.mp-featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 2px 10px;
    background: var(--mp-yellow-light);
    color: var(--mp-yellow);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 9999px;
    letter-spacing: 0.5px;
}

/* Card Header */
.mp-card-header {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
}

.mp-card-logo-wrap {
    flex-shrink: 0;
}

.mp-card-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--mp-gray-100);
}

.mp-card-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--mp-gray-500);
    background: var(--mp-gray-100);
}

.mp-card-info {
    min-width: 0;
    flex: 1;
}

.mp-card-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 2px;
    color: var(--mp-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-card-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--mp-gray-500);
    margin-bottom: 4px;
}

.mp-card-location svg {
    flex-shrink: 0;
}

.mp-card-links {
    display: flex;
    gap: 12px;
}

.mp-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--mp-blue);
    text-decoration: none;
    font-weight: 500;
}

.mp-link:hover {
    text-decoration: underline;
}

.mp-link svg {
    flex-shrink: 0;
}

/* Category Tags */
.mp-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.mp-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--mp-gray-100);
    border-radius: 9999px;
    font-size: 13px;
    color: var(--mp-gray-700);
    white-space: nowrap;
}

.mp-tag-more {
    background: var(--mp-gray-200);
    color: var(--mp-gray-500);
    font-weight: 500;
}

/* Description */
.mp-card-desc {
    font-size: 14px;
    color: var(--mp-gray-500);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Languages */
.mp-card-languages {
    font-size: 14px;
    color: var(--mp-gray-700);
    margin-bottom: 16px;
}

.mp-card-languages-label {
    color: var(--mp-gray-400);
    font-weight: 500;
    margin-right: 4px;
}

/* Card Footer */
.mp-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--mp-gray-100);
    margin-top: auto;
}

.mp-card-pricing {
    display: flex;
    gap: 16px;
}

.mp-price,
.mp-rate {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--mp-gray-700);
    font-weight: 500;
}

.mp-price svg,
.mp-rate svg {
    flex-shrink: 0;
    color: var(--mp-gray-400);
}

/* Card Actions */
.mp-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Share Button & Dropdown */
.mp-share-wrapper {
    position: relative;
}

.mp-btn-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--mp-gray-300);
    border-radius: var(--mp-radius-sm);
    background: transparent;
    color: var(--mp-gray-500);
    cursor: pointer;
    transition: all var(--mp-transition);
}

.mp-btn-share:hover {
    border-color: var(--mp-blue);
    color: var(--mp-blue);
    background: var(--mp-blue-light);
}

.mp-btn-share svg {
    flex-shrink: 0;
}

.mp-share-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    z-index: 100;
    min-width: 200px;
    background: var(--mp-white);
    border: 1px solid var(--mp-gray-200);
    border-radius: var(--mp-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 6px;
    animation: mp-dropdown-in 0.15s ease;
}

@keyframes mp-dropdown-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mp-share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: var(--mp-radius-sm);
    background: transparent;
    color: var(--mp-gray-700);
    font-family: var(--mp-font);
    font-size: 14px;
    cursor: pointer;
    transition: background var(--mp-transition);
    text-align: left;
}

.mp-share-option:hover {
    background: var(--mp-gray-50);
    color: var(--mp-dark);
}

.mp-share-option svg {
    flex-shrink: 0;
    color: var(--mp-gray-400);
}

.mp-share-option:hover svg {
    color: var(--mp-gray-700);
}

/* Share copied toast */
.mp-share-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20000;
    padding: 12px 24px;
    background: #1f2937;
    color: #ffffff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    animation: mp-toast-in 0.3s ease, mp-toast-out 0.3s ease 2.5s forwards;
    pointer-events: none;
}

@keyframes mp-toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes mp-toast-out {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
}

.mp-btn-contact {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    border: 1.5px solid var(--mp-gray-900);
    border-radius: var(--mp-radius-sm);
    background: transparent;
    color: var(--mp-gray-900);
    font-family: var(--mp-font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--mp-transition);
}

.mp-btn-contact:hover {
    background: var(--mp-gray-900);
    color: var(--mp-white);
}

.mp-btn-arrow {
    font-size: 16px;
}

/* ---- Pagination ---- */
.mp-pagination {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.mp-pagination .pagination {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mp-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--mp-gray-300);
    border-radius: var(--mp-radius-sm);
    background: var(--mp-white);
    color: var(--mp-gray-700);
    font-size: 14px;
    text-decoration: none;
    transition: all var(--mp-transition);
}

.mp-pagination .page-link:hover {
    background: var(--mp-gray-50);
    border-color: var(--mp-gray-400);
}

.mp-pagination .active .page-link {
    background: var(--mp-gray-900);
    color: var(--mp-white);
    border-color: var(--mp-gray-900);
}

/* ---- Empty State ---- */
.mp-empty {
    text-align: center;
    padding: 60px 24px;
}

.mp-empty-icon {
    margin-bottom: 16px;
}

.mp-empty-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--mp-dark);
}

.mp-empty-text {
    font-size: 15px;
    color: var(--mp-gray-500);
    margin: 0 0 24px;
}

/* ============================================================
   Contact Modal
   ============================================================ */
.mp-modal {
    --mp-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mp-dark: #111827;
    --mp-gray-900: #1f2937;
    --mp-gray-700: #374151;
    --mp-gray-500: #6b7280;
    --mp-gray-400: #9ca3af;
    --mp-gray-300: #d1d5db;
    --mp-gray-200: #e5e7eb;
    --mp-gray-100: #f3f4f6;
    --mp-gray-50: #f9fafb;
    --mp-white: #ffffff;
    --mp-blue: #2563eb;
    --mp-blue-light: #dbeafe;
    --mp-green: #059669;
    --mp-green-light: #d1fae5;
    --mp-red: #dc2626;
    --mp-red-light: #fee2e2;
    --mp-yellow: #d97706;
    --mp-yellow-light: #fef3c7;
    --mp-radius: 12px;
    --mp-radius-sm: 8px;
    --mp-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.12);
    --mp-transition: 0.2s ease;

    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: var(--mp-font);
    color: var(--mp-dark);
}

.mp-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.mp-modal-content {
    position: relative;
    z-index: 10002;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
}

.mp-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.mp-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.mp-modal-header {
    margin-bottom: 24px;
}

.mp-modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px;
    padding-right: 32px;
}

/* Step Indicator */
.mp-modal-steps {
    display: flex;
    align-items: center;
    gap: 0;
}

.mp-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 600;
    background: #ffffff;
    transition: all 0.2s ease;
}

.mp-step.active {
    border-color: #1f2937;
    background: #1f2937;
    color: #ffffff;
}

.mp-step-line {
    flex: 1;
    height: 2px;
    background: #d1d5db;
    margin: 0 4px;
}

/* Modal Body */
.mp-modal-body h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
    color: #111827;
}

/* Form Groups */
.mp-form-group {
    margin-bottom: 16px;
}

.mp-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--mp-gray-700);
    margin-bottom: 6px;
}

.mp-required {
    color: var(--mp-red);
}

.mp-textarea {
    font-family: var(--mp-font);
    font-size: 14px;
    padding: 10px 14px;
    border: 1px solid var(--mp-gray-300);
    border-radius: var(--mp-radius-sm);
    background: var(--mp-white);
    color: var(--mp-dark);
    outline: none;
    width: 100%;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color var(--mp-transition);
}

.mp-textarea:focus {
    border-color: var(--mp-blue);
    box-shadow: 0 0 0 3px var(--mp-blue-light);
}

.mp-char-count {
    display: block;
    font-size: 12px;
    color: var(--mp-gray-400);
    text-align: right;
    margin-top: 4px;
}

.mp-radio-group {
    display: flex;
    gap: 16px;
}

.mp-radio,
.mp-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--mp-gray-700);
    cursor: pointer;
}

.mp-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.mp-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.mp-help-text {
    display: block;
    font-size: 12px;
    color: var(--mp-gray-400);
    margin-top: 4px;
}

.mp-field-error {
    display: block;
    font-size: 12px;
    color: var(--mp-red);
    margin-top: 4px;
}

/* Modal Footer */
.mp-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.mp-btn-back {
    padding: 10px 24px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mp-btn-back:hover {
    background: #f9fafb;
}

.mp-btn-next,
.mp-btn-submit {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: #1f2937;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mp-btn-next:hover,
.mp-btn-submit:hover {
    background: #111827;
}

.mp-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal Message */
.mp-modal-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--mp-radius-sm);
    font-size: 14px;
    text-align: center;
}

.mp-message-success {
    background: var(--mp-green-light);
    color: var(--mp-green);
}

.mp-message-error {
    background: var(--mp-red-light);
    color: var(--mp-red);
}

/* Summary */
.mp-summary-section {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--mp-gray-100);
}

.mp-summary-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.mp-summary-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--mp-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}

.mp-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    margin-bottom: 4px;
}

.mp-summary-row > span:first-child {
    color: var(--mp-gray-500);
    flex-shrink: 0;
}

.mp-summary-row > span:last-child {
    color: var(--mp-dark);
    text-align: right;
    word-break: break-word;
}

/* ============================================================
   Submit Form
   ============================================================ */
.mp-submit-form {
    max-width: 720px;
    margin: 0 auto;
}

.mp-form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--mp-gray-100);
}

.mp-form-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--mp-dark);
}

.mp-form-row {
    display: flex;
    gap: 16px;
}

.mp-form-group-half {
    flex: 1;
}

@media (max-width: 640px) {
    .mp-form-row {
        flex-direction: column;
    }
}

.mp-logo-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mp-logo-preview {
    margin-bottom: 8px;
}

.mp-logo-current {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--mp-gray-200);
}

.mp-input-file {
    font-size: 14px;
    color: var(--mp-gray-700);
}

/* Status Bar */
.mp-status-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 14px 20px;
    background: var(--mp-gray-50);
    border-radius: var(--mp-radius-sm);
}

.mp-status-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--mp-gray-500);
}

.mp-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
}

.mp-status-pending {
    background: var(--mp-yellow-light);
    color: var(--mp-yellow);
}

.mp-status-approved {
    background: var(--mp-green-light);
    color: var(--mp-green);
}

.mp-status-rejected {
    background: var(--mp-red-light);
    color: var(--mp-red);
}

.mp-status-unpublished {
    background: var(--mp-gray-100);
    color: var(--mp-gray-500);
}

/* Form Actions */
.mp-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.mp-btn-cancel {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    border: 1px solid var(--mp-gray-300);
    border-radius: var(--mp-radius-sm);
    background: var(--mp-white);
    color: var(--mp-gray-700);
    font-family: var(--mp-font);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--mp-transition);
}

.mp-btn-cancel:hover {
    background: var(--mp-gray-50);
}

.mp-btn-submit-form {
    display: inline-flex;
    align-items: center;
    padding: 10px 28px;
    border: none;
    border-radius: var(--mp-radius-sm);
    background: var(--mp-gray-900);
    color: var(--mp-white);
    font-family: var(--mp-font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--mp-transition);
}

.mp-btn-submit-form:hover {
    background: var(--mp-dark);
}
