/*
 * ========================================================================
 * BravenSoft - Advanced Loyalty System - v1.3.0
 * Custom Stylesheet (Toggles, Referral Popup)
 * ========================================================================
 */
table.wp-list-table.widefat.fixed.striped {
    background-color: #BE3631;
}
/* ----------------------------------
 * 1. Admin Panel (NEW STYLES)
 * ---------------------------------- */
.wrap.bravens-admin-wrap {
    direction: rtl; text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
.bravens-admin-header {
    background: #ffffff; border: 1px solid #ccd0d4; border-bottom: 0;
    padding: 20px 30px; border-radius: 8px 8px 0 0; box-shadow: 0 1px 1px rgba(0,0,0,.04);
}
.bravens-admin-header h1 {
    font-size: 24px; font-weight: 600; display: flex; align-items: center;
    gap: 10px; color: #8a2be2; margin: 0;
}
.bravens-admin-header h1 .dashicons-star-filled { color: #8a2be2; font-size: 28px; width: 28px; height: 28px; }
.bravens-admin-header p { font-size: 16px; color: #555; margin: 5px 0 0 0; }
.wrap.bravens-admin-wrap .nav-tab-wrapper { padding: 0 20px; background: #fff; border-bottom: 1px solid #ccd0d4; margin: 0; }
.wrap.bravens-admin-wrap .nav-tab {
    font-size: 15px; font-weight: 500; padding: 12px 20px; border: 0;
    border-bottom: 3px solid transparent; margin-left: 5px; color: #555;
    display: inline-flex; align-items: center; gap: 8px;
}
.wrap.bravens-admin-wrap .nav-tab .dashicons { font-size: 20px; }
.wrap.bravens-admin-wrap .nav-tab:hover { color: #000; border-bottom-color: #ccd0d4; }
.wrap.bravens-admin-wrap .nav-tab-active,
.wrap.bravens-admin-wrap .nav-tab-active:hover { color: #8a2be2; border-bottom-color: #8a2be2; background: #f8f0ff; }
.bravens-admin-content { background: #fff; padding: 20px 30px; border: 1px solid #ccd0d4; border-top: 0; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.bravens-admin-section { padding: 20px; border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 25px; background: #fafafa; transition: opacity 0.3s ease; }
.wrap.bravens-admin-wrap .form-table { direction: rtl; }
.wrap.bravens-admin-wrap .form-table th { text-align: right; padding: 15px 10px 15px 0; width: 250px; }
.wrap.bravens-admin-wrap .wp-list-table th,
.wrap.bravens-admin-wrap .wp-list-table td { text-align: right; }
.bravens-admin-footer { text-align: center; margin-top: 20px; color: #777; }
.bravens-admin-footer a { color: #8a2be2; text-decoration: none; font-weight: 600; }

/* NEW: Admin Toggles */
.bravens-admin-section.bravens-disabled-section {
    opacity: 0.5;
    pointer-events: none;
}
.bravens-admin-wrap .form-table td { display: flex; align-items: center; gap: 15px; }
.bravens-switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.bravens-switch input { opacity: 0; width: 0; height: 0; }
.bravens-switch .slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc; transition: .4s;
}
.bravens-switch .slider:before {
    position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px;
    background-color: white; transition: .4s;
}
.bravens-switch input:checked + .slider { background-color: #8a2be2; }
.bravens-switch input:focus + .slider { box-shadow: 0 0 1px #8a2be2; }
.bravens-switch input:checked + .slider:before { transform: translateX(26px); }
.bravens-switch .slider.round { border-radius: 34px; }
.bravens-switch .slider.round:before { border-radius: 50%; }

/* Admin Manage Points Form */
.bravens-form-inline { display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-end; }
.bravens-form-inline .form-group { display: flex; flex-direction: column; gap: 5px; }
.bravens-form-inline .form-group label { font-weight: 600; font-size: 13px; }
.bravens-form-inline .form-group input,
.bravens-form-inline .form-group .select2-container { min-width: 200px; }
#bravens-admin-message { font-size: 14px; margin-top: 15px; padding: 10px; border-radius: 4px; border-right: 4px solid; }
#bravens-admin-message.success { background-color: #e6f7e9; color: #2b7d2b; border-color: #2b7d2b; }
#bravens-admin-message.error { background-color: #f8d7da; color: #721c24; border-color: #721c24; }

/* NEW: Admin User Column */
.column-bravens_referred_by { width: 15%; }

/* ----------------------------------
 * 2. "My Account" Dashboard Cards
 * ---------------------------------- */
.bravens-dashboard-container { direction: rtl; text-align: right; margin-bottom: 30px; }
.bravens-dashboard-header { border-bottom: 2px solid var(--e-a-btn-bg-accent) ; margin-bottom: 20px; padding-bottom: 10px;}
.bravens-dashboard-header h2 { font-size: 22px; font-weight: 700; margin: 0; color: #ffffff; text-align: center; background-color: indianred; padding: 10px; border-radius: 10px; }
.bravens-cards-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 20px; }
.bravens-card { border-radius: 12px; padding: 20px; color: #fff; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07); transition: transform 0.3s ease; text-align: right; }
.bravens-card:hover { transform: translateY(-3px); }
.bravens-card.gradient-purchase { background: linear-gradient(135deg, #8a2be2 0%, #a052d8 100%); text-align:center; }
.bravens-card.gradient-referral { background: linear-gradient(135deg, #5c6bc0 0%, #3f51b5 100%); text-align:center;}
.bravens-card.gradient-review { background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%); text-align:center; }
.bravens-card.gradient-total { background: linear-gradient(135deg, #26a69a 0%, #00897b 100%); text-align:center; }
.bravens-card-icon { font-size: 30px; line-height: 1; margin-bottom: 10px; opacity: 0.8; }
.bravens-card-title { font-size: 14px; font-weight: 500; margin-bottom: 5px; opacity: 0.9; white-space: normal; line-height: 1.3; }
.bravens-card-value { font-size: 24px; font-weight: 700; line-height: 1.2; margin-bottom: 3px; display: block; }
.bravens-card-subtitle { font-size: 12px; font-weight: 500; opacity: 0.9; line-height: 1.3; }
.bravens-card-subtitle strong { font-weight: 700; }
@media (min-width: 768px) {
    .bravens-cards-container { grid-template-columns: repeat(4, 1fr); gap: 20px; }
    .bravens-card { padding: 25px; }
    .bravens-card-icon { font-size: 36px; margin-bottom: 15px; }
    .bravens-card-title { font-size: 16px; margin-bottom: 8px; }
    .bravens-card-value { font-size: 30px; }
    .bravens-card-subtitle { font-size: 14px; }
}
.bravens-referral-box { background: #fafafa; border: 1px solid #e0e0e0; border-radius: 8px; padding: 25px; margin-bottom: 30px; }
.bravens-referral-box h3 { margin-top: 0; font-size: 18px; }
.bravens-referral-box p { font-size: 15px; color: #555; }
.bravens-referral-input-wrapper { display: flex; gap: 10px; }
#bravens-referral-url { flex-grow: 1; padding: 10px 15px; border: 1px solid #ccc; border-radius: 5px; background: #fff; direction: ltr; text-align: left; font-family: monospace; font-size: 14px; }
#bravens-copy-referral { flex-shrink: 0; background: #8a2be2; color: #fff; border: 0; padding: 0 20px; height: 44px; line-height: 44px; border-radius: 5px; cursor: pointer; font-weight: 600; transition: background-color 0.2s ease; }
#bravens-copy-referral:hover { background: #7a1fd0; }
#bravens-copy-referral.copied { background: #2b7d2b; }
.bravens-log-box h3 { font-size: 18px; margin-bottom: 15px; }
.bravens-log-table { width: 100%; }
.bravens-points.positive { color: #2b7d2b; font-weight: 700; }
.bravens-points.positive::before { content: '+'; margin-left: 2px; }
.bravens-points.negative { color: #dc3545; font-weight: 700; }

/* ----------------------------------
 * 3. Product Page Badge
 * ---------------------------------- */
.bravens-product-badge { background-color: #f8f0ff; border: 1px solid #e0c6f7; border-right: 3px solid #8a2be2; padding: 12px 15px; margin-top: 15px; border-radius: 5px; font-size: 14px; color: #333; direction: rtl; text-align: right; }
.bravens-product-badge strong { color: #8a2be2; font-weight: 700; }

/* ----------------------------------
 * 4. Cart / Checkout Points Box
 * ---------------------------------- */
.bravens-points-apply-box { padding: 20px; background: #fafafa; border: 1px dashed #d0d0d0; border-radius: 8px; margin-bottom: 20px; direction: rtl; text-align: right; }
.bravens-points-apply-box h3 { margin-top: 0; font-size: 18px; color: #000; }
.bravens-points-apply-box .available-points { font-size: 15px; color: #555; margin-bottom: 15px; }
.bravens-points-apply-box .available-points strong { color: #8a2be2; font-weight: 700; }
.bravens-points-apply-box .apply-form { display: flex; gap: 10px; }
.bravens-points-apply-box .apply-form input[type="number"] { flex-grow: 1; min-width: 100px; border-radius: 5px; border: 1px solid #ccc; padding: 0 12px; height: 44px; }
.bravens-points-apply-box .apply-form .button { flex-shrink: 0; background-color: #8a2be2; color: #fff; padding: 0 20px; height: 44px; line-height: 44px; border-radius: 5px; font-weight: 600; }
.bravens-points-apply-box .apply-form .button:hover { background-color: #7a1fd0; }
#bravens-points-message { font-size: 14px; margin-top: 10px; padding: 10px; border-radius: 4px; display: none; border-right: 4px solid; }
#bravens-points-message.success { background-color: #e6f7e9; color: #2b7d2b; border-color: #2b7d2b; }
#bravens-points-message.error { background-color: #f8d7da; color: #721c24; border-color: #721c24; }

/* ----------------------------------
 * 5. Thank You Page - Review Modal
 * ---------------------------------- */
.bravens-review-modal-wrapper { background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; padding: 30px; margin-top: 30px; box-shadow: 0 5px 25px rgba(0,0,0,0.07); text-align: center; direction: rtl; }
.bravens-review-modal .bravens-review-icon { font-size: 40px; line-height: 1; display: inline-block; margin-bottom: 10px; transform: rotate(-15deg); }
.bravens-review-modal h3 { font-size: 24px; margin-top: 0; margin-bottom: 10px; color: #000; }
.bravens-review-modal p { font-size: 16px; color: #555; margin-bottom: 25px; }
.bravens-review-modal .button.alt { background-color: #4285F4; color: #fff; font-weight: bold; font-size: 16px; padding: 12px 25px; border-radius: 8px; }
#bravens-review-step-2 { margin-top: 25px; }
#bravens-review-step-2 p { font-size: 15px; color: #333; text-align: right; font-weight: 500; }
#bravens-review-form textarea { width: 100%; min-height: 80px; margin-bottom: 15px; border-radius: 5px; border: 1px solid #ccc; padding: 10px; text-align: right; direction: rtl; }
#bravens-review-form .button { background-color: #8a2be2; color: #fff; width: 100%; padding: 12px; font-size: 16px; border-radius: 8px; }

/* ----------------------------------
 * 6. NEW: Referral Popup Modal
 * ---------------------------------- */
#bravens-referral-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
}
#bravens-referral-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    z-index: 10001;
    text-align: center;
    direction: rtl;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.bravens-modal-close {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #f0f0f0;
    border: 0;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 30px;
    color: #777;
    cursor: pointer;
    font-weight: bold;
}
.bravens-modal-close:hover {
    background: #e0e0e0;
    color: #000;
}
.bravens-modal-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 15px;
}
#bravens-referral-modal h3 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 10px;
    color: #000;
}
#bravens-referral-modal p {
    font-size: 16px;
    color: #555;
    margin-bottom: 25px;
}
.bravens-modal-button {
    background-color: #8a2be2;
    color: #fff;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
}
.bravens-modal-button:hover {
    background-color: #7a1fd0;
    color: #fff;
}
/* ----------------------------------
 * 7. Maintenance Tickets - My Account
 * ---------------------------------- */
.bravens-my-account-section.bravens-maintenance-tickets {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}
.bravens-maintenance-tickets h2 {
    font-size: 20px;
    margin-bottom: 20px;
}
.bravens-ticket-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-open { background-color: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.status-pending { background-color: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.status-answered { background-color: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; } /* Added */
.status-closed { background-color: #f5f5f5; color: #8c8c8c; border: 1px solid #d9d9d9; }
.status-rejected { background-color: #fff1f0; color: #f5222d; border: 1px solid #ffa39e; } /* Added */

/* Responsive table adjustments if needed */
@media (max-width: 767px) {
    .woocommerce-table--shop_table.shop_table_responsive .ticket-actions a {
         display: inline-block;
         margin-top: 5px;
    }
}
/* ----------------------------------
 * 8. [NEW] Maintenance Ticket Details Modal
 * ---------------------------------- */
/* Overlay and basic modal styles reuse .ultimate-modal-* */
.bravens-ticket-modal-overlay { z-index: 1000005; /* Higher than bar modal */ }
.bravens-ticket-modal-content { max-height: 85vh; /* Allow more height */ }
.bravens-ticket-modal-content h3 { text-align: right; font-size: 20px; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }

.ticket-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; color: #555; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px dashed #eee; }
.ticket-meta span { display: inline-flex; align-items: center; gap: 5px; }

.ticket-replies-container { max-height: 40vh; /* Limit replies height */ overflow-y: auto; margin-bottom: 20px; padding-right: 10px; /* Space for scrollbar */ }

.ticket-reply { border: 1px solid #e0e0e0; border-radius: 8px; padding: 15px; margin-bottom: 15px; position: relative; }
.ticket-reply.initial-data { background-color: #f9f9f9; border-style: dashed; }
.ticket-reply.reply-customer { background-color: #f0f8ff; border-color: #cce7ff; border-right: 3px solid #007bff; }
.ticket-reply.reply-admin { background-color: #fffaf0; border-color: #ffefcc; border-left: 3px solid #ffc107; } /* Admin replies styling */

.ticket-reply ul { list-style: none; padding: 0; margin: 5px 0 0 0; }
.ticket-reply li { margin-bottom: 8px; font-size: 14px; color: #333; }
.ticket-reply li strong { color: #000; display: inline-block; min-width: 100px; }
.ticket-reply li a { color: #007bc4; text-decoration: underline; }

.reply-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.reply-header strong { font-size: 14px; }
.reply-date { font-size: 12px; color: #777; }
.reply-content { font-size: 15px; line-height: 1.6; color: #333; }
.initial-data .reply-date { position: absolute; top: 10px; left: 10px; } /* Position date for initial data */

.ticket-reply-form h4 { font-size: 16px; margin-bottom: 10px; }
.ticket-reply-form textarea { min-height: 100px; }

/* Make scrollbar nicer (optional) */
.ticket-replies-container::-webkit-scrollbar { width: 6px; }
.ticket-replies-container::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.ticket-replies-container::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.ticket-replies-container::-webkit-scrollbar-thumb:hover { background: #aaa; }
/* ----------------------------------
 * 9. [NEW] Maintenance Tickets - Admin View
 * ---------------------------------- */
.bravens-admin-ticket-details { position: relative; border-left: 4px solid #007bc4; }
.bravens-admin-ticket-details h2 { font-size: 18px; margin-top: 0; }
.bravens-admin-ticket-details .ticket-meta { border-bottom: 1px dashed #ddd; margin-bottom: 20px; padding-bottom: 15px; font-size: 13px; }
.bravens-admin-ticket-details .ticket-meta span { margin-left: 15px; }

.ticket-replies-container.admin-replies { max-height: 50vh; overflow-y: auto; background: #fdfdfd; padding: 10px; border: 1px solid #eee; margin-bottom: 20px; }
.admin-replies .ticket-reply { border: 1px solid #eee; padding: 12px; margin-bottom: 10px; }
.admin-replies .ticket-reply.initial-data { background: #f9f9f9; border-style: dashed; }
.admin-replies .ticket-reply.reply-customer { background: #eef7ff; border-color: #d1eaff; }
.admin-replies .ticket-reply.reply-admin { background: #fff; border-color: #ddd; }
.admin-replies .reply-header { font-size: 12px; color: #777; margin-bottom: 5px; border-bottom: 1px dotted #eee; padding-bottom: 5px; }
.admin-replies .reply-header strong { color: #000; font-weight: 600; }
.admin-replies .reply-content { font-size: 14px; line-height: 1.6; }
.admin-replies .initial-data ul { margin-top: 10px; }
.admin-replies .initial-data li { margin-bottom: 5px; font-size: 13px; }
.admin-replies .initial-data li strong { min-width: 120px; }

.ticket-admin-actions h4 { font-size: 16px; margin-top: 0; margin-bottom: 10px; }
.ticket-admin-actions .ultimate-form-group { margin-bottom: 15px; }
.ticket-admin-actions textarea { width: 100%; min-height: 120px; }
.ticket-admin-actions select { min-width: 150px; }
.ticket-admin-actions .form-message { margin-top: 10px; }

/* Highlight selected row in admin table */
#the-list tr.current { background-color: #f0f6fc; }
#the-list tr.current td { box-shadow: inset 0 -1px 0 rgba(0,0,0,.1); }

/* ----------------------------------
 * Mobile Bar Wrapper (Base Styles)
 * ---------------------------------- */
@media (min-width: 769px) { #ultimate-bar-wrapper { display: none !important; } }
#ultimate-bar-wrapper {
    position: fixed !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%);
    width: 95% !important;
    max-width: 400px !important;
    height: 70px !important;
    z-index: 999999 !important; /* Ensure it's high, but below modals */
    animation: ultimate-slide-up 0.8s 0.2s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
@keyframes ultimate-slide-up {
    from { transform: translate(-50%, 120px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}
#ultimate-bar-bg {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 35px !important;
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}
#ultimate-bar-nav {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    padding: 0 10px;
}
/* ... Rest of the bar item styles ... */

/* ----------------------------------
 * Maintenance Modal Overlay & Content
 * ---------------------------------- */
.ultimate-modal-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.65);
    z-index: 1000006 !important;
    display: flex; /* Always flex now */
    align-items: center;
    justify-content: center;
    padding: 15px;
    direction: rtl;
    /* --- NEW Visibility Control --- */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s; /* Smooth fade, delay hiding */
}
/* --- NEW Class for Visibility --- */
.ultimate-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0s; /* Show immediately */
}

/* --- Ensure Content is Visible --- */
.ultimate-modal-content {
    background-color: #ffffff; /* تمت الإضافة: خلفية بيضاء */
    border-radius: 12px;       /* تمت الإضافة: حواف دائرية */
    padding: 30px;             /* تمت الإضافة: حشوة داخلية */
    padding-top: 45px;         /* تمت الإضافة: مساحة لزر الإغلاق */
    width: 90%;                /* تمت الإضافة: عرض النافذة */
    max-width: 500px;          /* تمت الإضافة: أقصى عرض */
    max-height: 85vh;          /* تمت الإضافة: أقصى ارتفاع */
    overflow-y: auto;          /* تمت الإضافة: تفعيل السكرول عند الحاجة */
    position: relative;        /* تمت الإضافة: لوضع زر الإغلاق بداخلها */
    text-align: right;         /* تمت الإضافة: محاذاة النص لليمين */

    opacity: 1; /* Ensure content itself is not transparent */
    transform: scale(1); /* Ensure content is not scaled down */
    transition: transform 0.3s ease; /* Optional: slight scale effect */
}
/* Optional: Scale effect on show */
.ultimate-modal-overlay.is-visible .ultimate-modal-content {
     transform: scale(1);
}
 .ultimate-modal-overlay .ultimate-modal-content { /* Start slightly scaled down */
     transform: scale(0.95);
}
@keyframes ultimate-modal-fade-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.ultimate-modal-close {
    position: absolute;
    top: 10px;
    left: 10px; /* Position top-left */
    background: #f1f1f1;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 30px; /* Center the X */
    text-align: center;
    cursor: pointer;
    color: #888;
    z-index: 10; /* Above content */
}
.ultimate-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}
/* ... Rest of the modal form styles (.ultimate-form-group etc.) ... */
/* ----------------------------------
 * Success Toast Notification (#ultimate-success-toast)
 * ---------------------------------- */
#ultimate-success-toast {
    position: fixed;
    bottom: -100px; /* ** Start hidden below the screen ** */
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    z-index: 9999999 !important; /* Make sure it's on top */
    transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1); /* Animate the bottom property */
    border-left: 5px solid #28a745; /* Green border */
    direction: rtl; /* Ensure RTL */
    opacity: 0; /* Start invisible for fade effect */
    visibility: hidden; /* Hide completely initially */
}

#ultimate-success-toast.is-visible {
    bottom: 30px; /* ** Move up into view ** */
    opacity: 1; /* Fade in */
    visibility: visible; /* Make visible */
}

#ultimate-success-toast span:not(.dashicons) { /* Target the text span */
    font-size: 15px;
    font-weight: 600;
    color: #28a745; /* Green text */
    margin-right: 10px;
}

#ultimate-success-toast .dashicons { /* Target the icon */
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #28a745; /* Green icon */
}

/* --- [FINAL FIX] --- */
/* Force My Account Ticket Modal Overlay to be visible when it has content */
/* We target the specific placeholder ID to ensure this only affects the correct modal */

#bravens-ticket-details-modal-placeholder .ultimate-modal-overlay.bravens-ticket-modal-overlay,
#bravens-ticket-details-modal-placeholder .ultimate-modal-overlay {
    display: flex !important; /* Use flex to center the content */
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1000005 !important; /* Ensure it's above other elements */
}

/* Ensure the content box is also visible */
#bravens-ticket-details-modal-placeholder .ultimate-modal-content.bravens-ticket-modal-content,
#bravens-ticket-details-modal-placeholder .ultimate-modal-content {
    display: block !important; /* Or flex if needed */
     visibility: visible !important;
     opacity: 1 !important;
}
/* --- [REVISED & ENHANCED] Maintenance Modal Styling v2 --- */

/* Modal Content Base */
.ultimate-modal-overlay#ultimate-modal-maintenance .ultimate-modal-content {
    padding: 0; 
    overflow: hidden; /* Prevent parent from scrolling */
    background-color: #f8f9fa; 
    display: flex; /* Use Flexbox for layout */
    flex-direction: column; /* Stack header, content, footer vertically */
    max-height: 85vh; /* Limit overall height */
    width: 90%; 
    max-width: 500px; 
    border-radius: 12px; /* Apply border radius here */
}

/* Close Button (X) Styling */
.ultimate-modal-overlay#ultimate-modal-maintenance .ultimate-modal-close {
    position: absolute;
    top: 10px;
    /* Changed from left to right for RTL */
    right: 10px; 
    left: auto; 
    background: rgba(255, 255, 255, 0.2); /* Semi-transparent white */
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 30px; 
    text-align: center;
    cursor: pointer;
    color: #ffffff; /* White X */
    z-index: 15; /* Ensure it's above the header */
    transition: background 0.2s ease;
}
.ultimate-modal-overlay#ultimate-modal-maintenance .ultimate-modal-close:hover {
    background: rgba(255, 255, 255, 0.4); /* Lighter on hover */
}

/* Header (Hero) Styling */
.modal-form-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    color: #ffffff;
    padding: 25px 30px;
    /* Remove border radius, it's on the parent now */
    text-align: center;
    flex-shrink: 0; /* Prevent header from shrinking */
}
.modal-form-header h3 {
    margin: 0 0 5px 0;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff; 
    border-bottom: none; 
    padding-bottom: 0; 
}
.modal-form-header p {
    margin: 0;
    font-size: 15px;
    opacity: 0.9;
    color: #ffffff; 
}

/* Scrollable Content Area Styling */
.modal-form-scrollable-content {
    flex-grow: 1; /* Allow this area to take available space */
    overflow-y: auto; /* Enable vertical scrolling ONLY here */
    overflow-x: hidden;
    background-color: #ffffff; /* White background for form area */
    padding: 25px 30px; 
}

/* Nicer Scrollbar (WebKit browsers like Chrome/Safari/Edge) */
.modal-form-scrollable-content::-webkit-scrollbar {
    width: 8px;
}
.modal-form-scrollable-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.modal-form-scrollable-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.modal-form-scrollable-content::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
/* Basic Scrollbar Styling (Firefox) */
.modal-form-scrollable-content {
  scrollbar-width: thin;          /* "auto" or "thin" */
  scrollbar-color: #ccc #f1f1f1;   /* thumb and track color */
}


/* Form Placeholder Adjustments */
#bravens-maintenance-form-placeholder {
    padding: 0; /* Remove padding from placeholder, it's on the scrollable parent now */
    background-color: transparent; /* Make placeholder transparent */
}
/* Style the form elements if needed (e.g., input padding) */
#bravens-maintenance-form .ultimate-form-group input[type="text"],
#bravens-maintenance-form .ultimate-form-group input[type="email"],
#bravens-maintenance-form .ultimate-form-group input[type="tel"],
#bravens-maintenance-form .ultimate-form-group input[type="url"],
#bravens-maintenance-form .ultimate-form-group input[type="file"],
#bravens-maintenance-form .ultimate-form-group select,
#bravens-maintenance-form .ultimate-form-group textarea {
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 12px 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#bravens-maintenance-form .ultimate-form-group input:focus,
#bravens-maintenance-form .ultimate-form-group select:focus,
#bravens-maintenance-form .ultimate-form-group textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

/* Submit Button Styling */
#bravens-maintenance-form .ultimate-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Match header gradient */
    color: #ffffff;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    width: 100%; /* Make button full width */
}
#bravens-maintenance-form .ultimate-submit-btn:hover {
    opacity: 0.9;
}
#bravens-maintenance-form .ultimate-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Footer Styling - RTL Focused, Gradient, 3 Columns, Correct Vertical & Icon Order */
.modal-form-footer {
    padding: 20px 25px; 
    text-align: center; 
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-top: none; 
    flex-shrink: 0;
    direction: rtl;
    border-radius: 0 0 12px 12px;
    /* Use Flexbox for the footer itself */
    display: flex;
    flex-direction: column; /* Stack children vertically */
    align-items: center; 
}

/* "Reply within 24 hours" text styling */
.modal-form-footer > p { 
    margin-top: 0;
    margin-bottom: 20px; 
    font-size: 14px;
    color: #ffffff;
    width: 100%; 
    text-align: center; 
    order: 1; /* !! Ensure this appears first (top) !! */
}

/* Container for contact items */
.modal-footer-contact-items {
    display: flex;
    flex-direction: row; 
    justify-content: space-between; 
    align-items: center;
    gap: 10px; 
    flex-wrap: wrap; 
    width: 100%; 
    order: 2; /* !! Ensure this appears second (bottom) !! */
    margin: 10px 40px 10px 45px;
}

/* Individual contact item styling */
.modal-form-footer-item {
    display: flex;
    align-items: center;
    justify-content: center; 
    gap: 8px; /* Space between icon and text */
    text-align: right; /* Text aligns to the right */
    flex: 1 1 30%; 
    min-width: 120px; 
}
.modal-form-footer-item .dashicons {
    font-size: 18px; 
    color: #ffffff;
    order: 1; /* !! Icon appears first (visually right in RTL) !! */
}
.modal-form-footer-item a,
.modal-form-footer-item span {
    color: #ffffff;
    text-decoration: none;
    order: 2; /* !! Text appears second (visually left in RTL) !! */
    font-size: 13px; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.modal-form-footer-item a:hover {
    color: #ffffff;
    opacity: 0.8;
}

/* Optional: Minor adjustments for very small screens if wrapping occurs */
@media (max-width: 400px) {
    .modal-footer-contact-items {
        justify-content: center; 
    }
     .modal-form-footer-item {
        flex-basis: 45%; 
        justify-content: flex-end; /* Align right if wrapping */
     }
}

/* --- End Maintenance Modal Styling v2 --- */
    
    /* Optional: Adjust form layout on desktop if needed */
    #bravens-maintenance-form .ultimate-form-group {
        margin-bottom: 20px; /* Add more space between fields */
    }
    
    /* Optional: Style footer differently on desktop */
     .modal-form-footer {
         display: flex;
         justify-content: space-around; /* Space out items horizontally */
         align-items: center;
         padding: 15px 30px;
     }
     .modal-form-footer p {
         margin-bottom: 0; /* Remove bottom margin from paragraph */
         order: 1; /* Move paragraph to the left */
     }
      .modal-form-footer-item {
         margin-bottom: 0; /* Remove bottom margin from items */
         order: 2; /* Move contact items to the right */
     }
