/* ========================================
   Global Styles
   ======================================== */

/* Apply custom font and background globally */
body {
    font-family: 'Inter', sans-serif;
    background-color: #F8F9FB;
    color: #1F2933;
    transition: all 150ms ease-in-out;
}

/* Custom hover effect for lift */
.hover-lift {
    transition: transform 150ms ease-in-out, box-shadow 150ms ease-in-out;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Style for the verified badge SVG */
.verified-badge {
    fill: #0F8A4B;
}

/* ========================================
   Freelancer Profile Styles
   ======================================== */

.profile-banner {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.profile-avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 6px solid white;
    position: absolute;
    bottom: -100px;
    left: 10%;
    transform: translateX(-50%);
    object-fit: cover;
    background: white;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Client profile avatar (smaller size) */
.client-profile-avatar {
    position: relative;
    cursor: pointer;
}

.client-profile-avatar .profile-photo-overlay {
    border-radius: inherit;
}

.score-badge {
    background: linear-gradient(135deg, #0F8A4B 0%, #0A6B38 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: #374151;
    margin: 0.25rem;
}

.language-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #F0F9FF;
    border: 1px solid #BAE6FD;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: #0C4A6E;
    margin: 0.25rem;
}

.verification-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.verified {
    background: #D1FAE5;
    color: #065F46;
}

.unverified {
    background: #FEE2E2;
    color: #991B1B;
}

.provisional {
    background: #FEF3C7;
    color: #92400E;
}

.section-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.fee-card {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    text-align: center;
}

.fee-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0F8A4B;
}

.fee-label {
    font-size: 0.875rem;
    color: #6B7280;
    margin-top: 0.25rem;
}

/* ========================================
   Marketplace Freelancer Listing Styles
   ======================================== */

.freelancer-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.2s ease;
    display: flex;
    gap: 1.5rem;
    height: 100%;
}

.freelancer-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.freelancer-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
    flex-shrink: 0;
}

/* Marketplace specific score badge */
.freelancer-card .score-badge {
    padding: 0.375rem 0.75rem;
    display: inline-block;
}

/* Marketplace specific verification badge */
.freelancer-card .verification-badge {
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
}

/* Marketplace specific skill tag */
.freelancer-card .skill-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    margin: 0.125rem;
}

.filter-section {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    padding: 1.5rem;
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.skill-tag-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 9999px;
    font-size: 0.75rem;
    color: #374151;
    margin: 0.25rem;
}

.skill-tag-filter button {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #6B7280;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
}

.skill-tag-filter button:hover {
    background: #374151;
}

.autocomplete-dropdown {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #E5E7EB;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-dropdown.hidden {
    display: none;
}

.autocomplete-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.autocomplete-item:hover {
    background: #F3F4F6;
}

.autocomplete-item.selected {
    background: #E0F2FE;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
}

.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.375rem;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #F3F4F6;
}

.pagination .current {
    background: #0F8A4B;
    color: white;
    border-color: #0F8A4B;
}

.location-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #6B7280;
    font-size: 0.875rem;
}

.fee-display {
    color: #475569;
    font-weight: 600;
    font-size: 1rem;
}

/* ========================================
   RTL Support
   ======================================== */

/* RTL Support */
[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .space-x-2 > * + *,
[dir="rtl"] .space-x-4 > * + *,
[dir="rtl"] .space-x-6 > * + *,
[dir="rtl"] .space-x-8 > * + * {
    margin-left: 0;
}

[dir="rtl"] .space-x-2 > *:not(:last-child) {
    margin-right: 0.5rem;
}

[dir="rtl"] .space-x-4 > *:not(:last-child) {
    margin-right: 1rem;
}

[dir="rtl"] .space-x-6 > *:not(:last-child) {
    margin-right: 1.5rem;
}

[dir="rtl"] .space-x-8 > *:not(:last-child) {
    margin-right: 2rem;
}

[dir="rtl"] .mr-2 {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .mr-4 {
    margin-right: 0;
    margin-left: 1rem;
}

[dir="rtl"] .ml-2 {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .pl-12 {
    padding-left: 0;
    padding-right: 3rem;
}

[dir="rtl"] .pr-6 {
    padding-right: 0;
    padding-left: 1.5rem;
}

[dir="rtl"] .left-4 {
    left: auto;
    right: 1rem;
}

/* ========================================
   Registration Wizard Styles
   ======================================== */

/* Wizard progress bar */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 3rem;
}

.wizard-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.wizard-step::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #E4E7EB;
    z-index: 0;
}

.wizard-step:first-child::before {
    left: 50%;
}

.wizard-step:last-child::before {
    right: 50%;
}

.wizard-step.active::before,
.wizard-step.completed::before {
    background: #0F8A4B;
}

.wizard-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #E4E7EB;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6B7280;
    margin: 0 auto 0.5rem;
    position: relative;
    z-index: 2;
}

.wizard-step.active .wizard-circle {
    border-color: #0F8A4B;
    background: #0F8A4B;
    color: white;
}

.wizard-step.completed .wizard-circle {
    border-color: #0F8A4B;
    background: #0F8A4B;
    color: white;
}

.wizard-label {
    font-size: 0.875rem;
    color: #6B7280;
    display: block;
}

.wizard-step.active .wizard-label {
    color: #0F8A4B;
    font-weight: 600;
}

/* Image cropper container */
.image-cropper {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 3px solid #0F8A4B;
    margin: 0 auto;
}

.image-cropper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide wizard progress for login/password reset pages */
.hide-wizard-progress .wizard-progress {
    display: none !important;
}

/* ========================================
   Freelancer Profile Step 4 Styles
   ======================================== */

.banner-container {
    position: relative;
    width: calc(100% + 4rem);
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    margin: -2rem -2rem 0 -2rem;
    border-radius: 12px 12px 0 0;
}

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

.banner-upload-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s;
}

.banner-upload-btn:hover {
    transform: scale(1.1);
}

.profile-section {
    position: relative;
    margin-top: -80px;
    padding: 0 2rem 0 0.5rem;
    display: flex;
    gap: 2rem;
    align-items: flex-end;
}

.profile-photo-container {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    background: white;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.profile-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-upload-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #6B7280;
    transition: all 0.3s;
}

.profile-photo-container:hover .profile-upload-placeholder {
    background: #e5e7eb;
}

.cropper-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    opacity: 0.92;
    z-index: 999998;
}

.cropper-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    pointer-events: none;
}

.cropper-content-box {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
}

.cropper-image-container {
    max-height: 500px;
    margin: 1.5rem 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.cropper-image-container img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

/* Circular crop box for profile photos */
.cropper-profile .cropper-view-box,
.cropper-profile .cropper-face {
    border-radius: 50%;
}

.cropper-profile .cropper-view-box {
    box-shadow: 0 0 0 1px #39f;
    outline: 0;
}

.language-tag button {
    background: none;
    border: none;
    color: #0C4A6E;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #E4E7EB;
    border-radius: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #F8F9FB;
}

.validation-error-banner {
    background-color: #FEE2E2;
    border: 1px solid #EF4444;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.field-error {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
}

.validation-success-banner {
    background-color: #D1FAE5;
    border: 1px solid #0F8A4B;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* ========================================
   Client Step 1 Profile Photo Styles
   ======================================== */

/* Smaller profile photo container for client registration */
.client-profile-photo-container {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #E5E7EB;
    background: white;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.client-profile-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.client-profile-photo-container .profile-upload-placeholder {
    background: #F9FAFB;
}

.client-profile-photo-container:hover .profile-upload-placeholder {
    background: #F3F4F6;
}

/* ========================================
   Profile Editing & Validation Styles
   ======================================== */

/* Validation Error Banner */
.validation-error-banner {
    animation: slideDown 0.3s ease-out;
}

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

/* Field Error Highlighting */
.field-error {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Profile Action Buttons */
.profile-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background-color: #0F8A4B;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: #0C6B3A;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background-color: white;
    color: #374151;
    border: 2px solid #D1D5DB;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: #F9FAFB;
    border-color: #9CA3AF;
}

/* Profile Photo Overlay (similar to registration step3) */
.profile-photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.profile-avatar:hover .profile-photo-overlay {
    opacity: 1;
}

.profile-photo-overlay-content {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Banner Upload Overlay */
.banner-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.profile-banner:hover .banner-upload-overlay {
    opacity: 1;
}

.banner-upload-overlay-content {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Editable Field Styles */
input[data-field],
textarea[data-field],
select[data-field] {
    transition: all 0.2s;
}

input[data-field]:focus,
textarea[data-field]:focus,
select[data-field]:focus {
    outline: none;
    border-color: #0F8A4B;
    ring: 2px;
    ring-color: rgba(15, 138, 75, 0.2);
    box-shadow: 0 0 0 3px rgba(15, 138, 75, 0.1);
}

/* Toast Notifications */
.toast {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading Animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background-color: white;
    border-radius: 0.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem 1rem 1.5rem;
    margin-top: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #0F8A4B;
    box-shadow: 0 0 0 3px rgba(15, 138, 75, 0.1);
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.25rem;
    cursor: pointer;
}

.form-checkbox:checked {
    background-color: #0F8A4B;
    border-color: #0F8A4B;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Edit/Delete Button Styles */
.employment-item,
.certification-item,
.language-item,
.education-item {
    position: relative;
}

.employment-item button,
.certification-item button,
.language-item button,
.education-item button {
    transition: all 0.2s;
}

.employment-item:hover,
.certification-item:hover,
.language-item:hover,
.education-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 0.25rem;
}
