/* Zwaj Plugin Styles (Modern Royal Theme - Olfa) */

@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');

/* Root Variables - Modern Royal Theme */
:root {
    --zwaj-navy: #0a192f;
    --zwaj-navy-light: #162a45;
    --zwaj-gold: #d4af37;
    --zwaj-gold-hover: #b8860b;
    --zwaj-text-main: #1f2937;
    --zwaj-text-light: #6b7280;
    --zwaj-bg-body: #f4f6f8;
    --zwaj-bg-white: #ffffff;
    --zwaj-input-bg: #ffffff;
    --zwaj-shadow: 0 10px 40px -10px rgba(10, 25, 47, 0.1);
    --zwaj-border-radius: 16px;
}

/* Global Typography */
h1,
h2,
h3,
h4,
.zwaj-card-name {
    font-family: 'Amiri', serif;
}

body,
input,
button,
select,
textarea,
.zwaj-app-wrapper {
    font-family: 'Almarai', sans-serif;
}

/* Base Wrapper */
.zwaj-app-wrapper {
    direction: rtl;
    color: var(--zwaj-text-main);
    background-color: var(--zwaj-bg-body);
    padding: 20px;
    box-sizing: border-box;
}

.zwaj-app-wrapper * {
    box-sizing: border-box;
}

/* Resend Button Styling */
#zwaj-resend-btn {
    padding: 8px 15px;
    font-size: 0.9rem;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* ---------------------------------------------------------
   Search Bar Styles
--------------------------------------------------------- */
.zwaj-search-container {
    background-color: var(--zwaj-bg-white);
    padding: 25px;
    border-radius: var(--zwaj-border-radius);
    box-shadow: var(--zwaj-shadow);
    margin-bottom: 40px;
    border-bottom: 3px solid var(--zwaj-gold);
}

.zwaj-search-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: end;
}

.zwaj-search-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--zwaj-navy);
}

.zwaj-search-input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Almarai', sans-serif;
    transition: all 0.3s;
    background-color: #f9fafb;
    font-size: 1rem;
}

.zwaj-search-input:focus {
    border-color: var(--zwaj-gold);
    background-color: #fff;
    outline: none;
}

.zwaj-search-btn {
    height: 50px;
    background-color: var(--zwaj-navy);
    color: var(--zwaj-gold);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--zwaj-navy);
}

.zwaj-search-btn:hover {
    background-color: #fff;
    color: var(--zwaj-navy);
    transform: translateY(-2px);
}

/* ---------------------------------------------------------
   Results Grid
--------------------------------------------------------- */
.zwaj-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* ---------------------------------------------------------
   Card Styles (Modern Royal)
--------------------------------------------------------- */
.zwaj-card {
    background: var(--zwaj-bg-white);
    border-radius: var(--zwaj-border-radius);
    overflow: hidden;
    box-shadow: var(--zwaj-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.zwaj-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -10px rgba(10, 25, 47, 0.2);
}

.zwaj-card.is-diamond {
    border: 2px solid var(--zwaj-gold);
}

/* Tier: Mumayaz (Crown) */
.zwaj-card.tier-mumayaz::before {
    content: '👑';
    position: absolute;
    top: 10px;
    left: 10px;
    /* RTL top-left ? No, user said top-right for Crown? Checking req: "Restore Gold Crown: For .tier-mumayaz... top-right".  Wait, req said "Diamond Icon... top-left" */
    /* Let's re-read carefully: "Restore Gold Crown: For .tier-mumayaz... positioned at the top-right." */
    right: 10px;
    left: auto;
    font-size: 2rem;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Tier: Diamond (Image Badge Removed) */
/* .zwaj-card.tier-diamond::after { ... } REMOVED per V1.3.2 Request */
/* Keeping the border and label styles, just removing the "Star"/Icon overlay. */

/* Base Label Style */
.zwaj-tier-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    margin-top: 5px;
    background-color: #9ca3af;
    /* Default gray */
}

/* Tier Colors */
/* Raqi Male -> Dark Blue */
.zwaj-card.tier-raqi.gender-male .zwaj-tier-label {
    background-color: #1e3a8a;
    /* Dark Blue */
}

/* Raqi Female -> Dark Pink */
.zwaj-card.tier-raqi.gender-female .zwaj-tier-label {
    background-color: #be185d;
    /* Dark Pink */
}

/* Mumayaz -> Gold */
.zwaj-card.tier-mumayaz .zwaj-tier-label {
    background-color: var(--zwaj-gold);
    color: #fff;
}

/* Diamond -> Cyan/Teal */
.zwaj-card.tier-diamond .zwaj-tier-label {
    background-color: #06b6d4;
    /* Cyan */
}

.zwaj-card-img-wrapper {
    height: 250px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.zwaj-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.zwaj-card:hover .zwaj-card-img {
    transform: scale(1.05);
}

.zwaj-card-body {
    padding: 25px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.zwaj-card-name {
    font-family: 'Amiri', serif;
    font-size: 1.8rem;
    color: var(--zwaj-navy);
    margin: 0 0 5px;
    font-weight: 700;
}

.zwaj-card-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.zwaj-card-link:hover {
    color: var(--zwaj-gold);
}

.zwaj-card-info {
    color: var(--zwaj-text-light);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.zwaj-reputation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #fefced;
    color: #b45309;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    margin-bottom: 20px;
    border: 1px solid #fde68a;
}

.zwaj-card-actions {
    margin-top: auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.zwaj-card-actions .zwaj-btn {
    flex: 1;
    width: auto;
}

.zwaj-btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #ef4444;
    /* Red-500 */
    font-size: 1.2rem;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zwaj-btn-icon:hover {
    background-color: #fee2e2;
    /* Red-100 */
    color: #b91c1c;
    /* Red-700 */
}

.zwaj-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* Gold Button */
.zwaj-btn-gold {
    background-color: var(--zwaj-gold);
    color: #fff;
    box-shadow: 0 4px 6px rgba(212, 175, 55, 0.2);
}

.zwaj-btn-gold:hover {
    background-color: var(--zwaj-gold-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(212, 175, 55, 0.3);
}

/* Royal Green Button */
.zwaj-btn-royal-green {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    box-shadow: 0 4px 6px rgba(5, 150, 105, 0.2);
}

.zwaj-btn-royal-green:hover {
    filter: brightness(1.1);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(5, 150, 105, 0.3);
}

/* ---------------------------------------------------------
   Registration Form Styles (Updated)
--------------------------------------------------------- */
.zwaj-registration-container {
    background-color: var(--zwaj-bg-white);
    color: var(--zwaj-text-main);
    padding: 50px;
    border-radius: 20px;
    max-width: 800px;
    margin: 40px auto;
    box-shadow: var(--zwaj-shadow);
    font-family: 'Almarai', sans-serif;
    direction: rtl;
    border-top: 5px solid var(--zwaj-navy);
}

.zwaj-registration-container h2 {
    font-family: 'Amiri', serif;
    color: var(--zwaj-navy);
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 40px;
}

.zwaj-registration-container * {
    box-sizing: border-box;
}

.zwaj-form-group {
    margin-bottom: 25px;
}

.zwaj-form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--zwaj-navy);
    font-weight: 700;
    font-size: 1.1rem;
}

.zwaj-form-control {
    width: 100%;
    height: 55px;
    /* Comfortable height */
    padding: 10px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background-color: #fcfcfc;
    color: var(--zwaj-text-main);
    font-family: 'Almarai', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

textarea.zwaj-form-control {
    height: auto;
    min-height: 150px;
    padding-top: 15px;
}

.zwaj-form-control:focus {
    outline: none;
    border-color: var(--zwaj-navy);
    box-shadow: 0 0 0 4px rgba(10, 25, 47, 0.1);
}

.zwaj-submit-btn {
    width: 100%;
    height: 60px;
    background-color: var(--zwaj-navy);
    color: var(--zwaj-gold);
    border: none;
    border-radius: 12px;
    font-family: 'Almarai', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    border: 1px solid var(--zwaj-navy);
}

.zwaj-submit-btn:hover {
    background-color: #fff;
    color: var(--zwaj-navy);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Messages */
.zwaj-message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
}

.zwaj-success {
    background-color: #ecfdf5;
    border: 1px solid #10b981;
    color: #047857;
}

.zwaj-error {
    background-color: #fef2f2;
    border: 1px solid #ef4444;
    color: #b91c1c;
}

/* ---------------------------------------------------------
   Login Form Styles (WP Override)
--------------------------------------------------------- */
.zwaj-login-wrapper {
    font-family: 'Almarai', sans-serif;
    direction: rtl;
    border-top: 4px solid var(--zwaj-gold);
}

.zwaj-login-wrapper form {
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
    border: none;
}

.zwaj-login-wrapper .login-username,
.zwaj-login-wrapper .login-password {
    margin-bottom: 20px !important;
}

.zwaj-login-wrapper label {
    display: block;
    margin-bottom: 8px;
    color: var(--zwaj-navy);
    font-weight: 700;
    font-size: 1rem;
    width: 100%;
}

.zwaj-login-wrapper .input {
    width: 100% !important;
    height: 50px !important;
    font-size: 16px !important;
    padding: 0 15px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    background: #f9fafb !important;
    color: var(--zwaj-text-main) !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.zwaj-login-wrapper .input:focus {
    border-color: var(--zwaj-gold) !important;
    background-color: #fff !important;
    outline: none !important;
}

.zwaj-login-wrapper .login-submit {
    margin-top: 20px;
}

.zwaj-login-wrapper .button-primary {
    width: 100% !important;
    height: 50px !important;
    background-color: var(--zwaj-navy) !important;
    color: var(--zwaj-gold) !important;
    border: none !important;
    border-radius: 8px !important;
    font-family: 'Almarai', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    text-shadow: none !important;
    box-shadow: none !important;
    float: none !important;
    display: block !important;
}

.zwaj-login-wrapper .button-primary:hover {
    background-color: #1a2f4c !important;
    transform: translateY(-2px);
}

.zwaj-login-wrapper .forgetmenot {
    float: none !important;
    margin-bottom: 15px !important;
    display: block !important;
}

/* Responsive */
@media (max-width: 768px) {
    .zwaj-search-form {
        grid-template-columns: 1fr;
    }

    .zwaj-registration-container {
        padding: 30px 20px;
    }

    .zwaj-results-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------
   Chat System Styles
--------------------------------------------------------- */
.zwaj-chat-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.zwaj-chat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.zwaj-chat-item:hover {
    background: #f9fafb;
    border-color: var(--zwaj-gold);
    transform: translateX(-5px);
}

.zwaj-chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--zwaj-gold);
}

.zwaj-chat-details {
    flex: 1;
}

.zwaj-chat-name {
    font-weight: 700;
    color: var(--zwaj-navy);
    margin-bottom: 5px;
}

.zwaj-chat-preview {
    color: var(--zwaj-text-light);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.zwaj-chat-time {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Chat Window */
.zwaj-chat-window {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.zwaj-chat-header {
    padding: 15px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.zwaj-chat-header-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.zwaj-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f0f2f5;
    /* Light WhatsApp gray */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zwaj-message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    position: relative;
    font-size: 1rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.zwaj-message-mine {
    align-self: flex-end;
    /* RTL: Left side is end? No, usually Right. */
    /* Let's be careful. In RTL, Flex-Start is Right, Flex-End is Left. */
    /* If we want Mine on Right (Gold), we actually need flex-start in RTL context? */
    /* Or we force direction LTR for physics but RTL for text? */
    /* Standard WhatsApp: Mine is RIGHT. Theirs is LEFT. regardless of language usually, but in Arabic UI it flips. */
    /* In Arabic WA: Mine is LEFT (Green), Theirs is RIGHT (White). */
    /* USER requested: "Align Right (align-self: flex-end)". I will follow USER instruction explicitly. */
    align-self: flex-end;
    background-color: #d4af37;
    /* Gold */
    color: #fff;
    border-radius: 15px 15px 0 15px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.zwaj-message-theirs {
    align-self: flex-start;
    background-color: #ffffff;
    color: #333;
    border-radius: 15px 15px 15px 0;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.zwaj-message-time {
    display: block;
    font-size: 0.7rem;
    margin-top: 5px;
    opacity: 0.8;
}

.zwaj-chat-footer {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #ddd;
}

.zwaj-chat-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zwaj-chat-input {
    flex: 1;
    border-radius: 25px;
    /* Pill shape */
    border: 1px solid #ccc;
    padding: 12px 20px;
    font-family: inherit;
    resize: none;
    height: 50px;
    /* Fixed height for single line feel, or auto grow */
    outline: none;
    transition: border-color 0.2s;
}

.zwaj-chat-input:focus {
    border-color: var(--zwaj-gold);
}

.zwaj-chat-send {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    /* Circle */
    background: var(--zwaj-gold);
    color: #fff;
    border: none;
    /* No border as per request, just gold bg */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.zwaj-chat-send:hover {
    transform: scale(1.1);
    background-color: #c5a028;
    /* Slightly darker gold */
    color: #fff;
}

/* Reputation Header Actions */
.zwaj-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.zwaj-reputation-label {
    font-size: 0.9rem;
    color: var(--zwaj-text-light);
}

/* ---------------------------------------------------------
   Single Profile Template
--------------------------------------------------------- */
.zwaj-single-wrapper {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 900px) {
    .zwaj-single-wrapper {
        grid-template-columns: 1fr;
    }
}

.zwaj-single-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.zwaj-content-section {
    background: #fff;
    padding: 30px;
    border-radius: var(--zwaj-border-radius);
    box-shadow: var(--zwaj-shadow);
    border: 1px solid #e5e7eb;
}

.zwaj-content-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-family: 'Amiri', serif;
    color: var(--zwaj-navy);
    font-size: 1.5rem;
    border-bottom: 2px solid var(--zwaj-gold);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.zwaj-section-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--zwaj-text-main);
}

/* ---------------------------------------------------------
   Floating Profile & Notification Styles (Fixed Position)
--------------------------------------------------------- */
#zwaj-floating-profile {
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    z-index: 9999999 !important;
    width: 60px !important;
    height: 60px !important;
    display: block !important;
}

#zwaj-floating-profile img {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
}

/* ---------------------------------------------------------
   Subscription Tiers (V1.3.0)
--------------------------------------------------------- */

/* Container Setup for Badge */
.zwaj-card-container,
.zwaj-card {
    position: relative;
    /* Ensure absolute badge works */
    border: 3px solid transparent;
    /* Reserve space */
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* 1. Raqi (راقي) */
.tier-raqi.gender-male,
.zwaj-card.tier-raqi.gender-male,
.zwaj-card-container.tier-raqi.gender-male {
    border-color: #003366;
    /* Dark Blue */
    box-shadow: 0 5px 15px rgba(0, 51, 102, 0.15);
}

.tier-raqi.gender-female,
.zwaj-card.tier-raqi.gender-female,
.zwaj-card-container.tier-raqi.gender-female {
    border-color: #C71585;
    /* Dark Pink */
    box-shadow: 0 5px 15px rgba(199, 21, 133, 0.15);
}

/* 2. Mumayaz (مميز) - Gold */
.tier-mumayaz,
.zwaj-card.tier-mumayaz,
.zwaj-card-container.tier-mumayaz {
    border-color: var(--zwaj-gold);
    /* #d4af37 */
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

/* 3. Diamond (ماسي) */
.tier-diamond,
.zwaj-card.tier-diamond,
.zwaj-card-container.tier-diamond {
    border-color: #E0FFFF;
    /* Light Cyan */
    box-shadow: 0 0 20px rgba(224, 255, 255, 0.6), 0 0 10px rgba(0, 191, 255, 0.3);
    /* Glow */
    background: linear-gradient(to bottom right, #fff, #f0f9ff);
}

/* Diamond Badge Icon */
.zwaj-diamond-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    /* Top-Left as requested */
    width: 32px;
    height: 32px;
    z-index: 20;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Adjustments for existing 'is-diamond' class if any (Legacy) */
.zwaj-card.is-diamond::before {
    display: none;
    /* Hide old ribbon if we use new system */
}



#zwaj-unread-badge {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    background: #ff0000 !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    min-width: 22px !important;
    height: 22px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 11px !important;
    font-weight: bold !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Toast Notification Global */
#zwaj-toast {
    position: fixed !important;
    top: -100px;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10000000 !important;
    pointer-events: none;
}

.zwaj-toast-content {
    background: #0a192f !important;
    color: #d4af37 !important;
    padding: 12px 25px !important;
    border-radius: 50px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
    border: 2px solid #d4af37 !important;
    font-weight: bold !important;
}

/* Chat Date Separator */
.zwaj-chat-date-separator {
    text-align: center;
    margin: 15px 0;
    width: 100%;
}

.zwaj-chat-date-separator span {
    background-color: #e1f5fe;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #555;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
    display: inline-block;
}