/* ==========================================================
   1. WooCommerce My Account Global Layout (Bulletproof)
   ========================================================== */
/* Clearfix for dashboard wrap to ensure it respects float elements */
.woocommerce::after {
    content: "";
    display: table;
    clear: both;
}

/* Navigation Sidebar */
.woocommerce .woocommerce-MyAccount-navigation {
    float: left;
    width: 25%;
    margin-bottom: 40px;
    box-sizing: border-box;
}

.woocommerce .woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #eee;
}

.woocommerce .woocommerce-MyAccount-navigation ul li {
    border-bottom: 1px solid #f5f5f5;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce .woocommerce-MyAccount-navigation ul li:last-child {
    border-bottom: none;
}

.woocommerce .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 16px 20px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.woocommerce .woocommerce-MyAccount-navigation ul li a:hover {
    background-color: #fff9ed;
    color: #f5ad0d;
    padding-left: 25px;
}

.woocommerce .woocommerce-MyAccount-navigation ul li.is-active a {
    background-color: #f5ad0d;
    color: #fff;
}

/* Content Area */
.woocommerce .woocommerce-MyAccount-content {
    float: right;
    width: calc(75% - 30px);
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    box-sizing: border-box;
    margin-bottom: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .woocommerce .woocommerce-MyAccount-navigation {
        float: none;
        width: 100%;
    }

    .woocommerce .woocommerce-MyAccount-content {
        float: none;
        width: 100%;
        margin-top: 20px;
    }
}

/* Tables */
.woocommerce table.shop_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eeeeee;
}

.woocommerce table.shop_table th {
    background-color: #f8f8f8;
    font-weight: 600;
    color: #333;
}

/* Buttons */
.woocommerce .button,
.pofm-btn-submit,
.pofm-btn-edit,
.pofm-chat-submit {
    background-color: #f5ad0d !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    cursor: pointer !important;
    font-size: 15px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.pofm-chat-submit {
    height: 50px !important;
}

.woocommerce .button:hover,
.pofm-btn-submit:hover,
.pofm-btn-edit:hover,
.pofm-chat-submit:hover {
    background-color: #d9960a !important;
    /* Slightly darker */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(245, 173, 13, 0.3);
}

.woocommerce .button.insert-media {
    margin-bottom: 12px !important;
}

/* ==========================================================
   2. Plugin Specific Styles (My Products & Edit Form)
   ========================================================== */
.pofm-products-wrapper table img {
    max-width: 50px;
    height: auto;
    border-radius: 4px;
}

.pofm-status-badge {
    font-size: 0.85em;
    color: #777;
    margin-left: 5px;
}

.pofm-edit-form {
    background: #fbfbfb;
    padding: 25px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.pofm-edit-form .form-row {
    margin-bottom: 20px;
}

.pofm-edit-form input[type="text"],
.pofm-edit-form input[type="number"],
.pofm-edit-form textarea,
.woocommerce input[type="text"],
.woocommerce input[type="password"],
.woocommerce input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.3s;
    background: #fff;
}

.pofm-edit-form input:focus,
.pofm-edit-form textarea:focus,
.woocommerce input:focus {
    border-color: #f5ad0d;
    outline: none;
    box-shadow: 0 0 0 3px rgba(245, 173, 13, 0.1);
}

/* ==========================================================
   3. Chat UI Styles
   ========================================================== */
.pofm-chat-wrapper {
    max-width: 100%;
}

.pofm-chat-container {
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 500px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.pofm-chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fcfcfc;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pofm-chat-message-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    width: 100%;
}

.pofm-chat-message-row.pofm-chat-mine {
    flex-direction: row-reverse;
}

.pofm-chat-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pofm-chat-bubble {
    max-width: 75%;
    background: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #eaeaea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pofm-chat-mine .pofm-chat-bubble {
    background: #f5ad0d !important;
    border-color: #e09d0b !important;
    color: #fff;
}

.pofm-chat-mine .pofm-chat-bubble .pofm-chat-time,
.pofm-chat-mine .pofm-chat-bubble .pofm-chat-sender {
    color: rgba(255, 255, 255, 0.9) !important;
}

.pofm-chat-sender {
    display: block;
    font-size: 0.85em;
    color: #555;
    margin-bottom: 4px;
    font-weight: 600;
}

.pofm-chat-text {
    line-height: 1.5;
    word-break: break-word;
}

.pofm-chat-load-older-btn {
    display: inline-block;
    background: #fff;
    color: #f5ad0d;
    border: 1px solid #f5ad0d;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.pofm-chat-load-older-btn:hover {
    background: #f5ad0d;
    color: #fff;
}

.pofm-chat-text img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 8px;
    display: block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pofm-chat-time {
    font-size: 0.75em;
    color: #999;
    margin-top: 6px;
    text-align: right;
}

.pofm-chat-input-area {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
}

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

.pofm-chat-input-area textarea {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: none;
    padding: 12px;
    height: 50px;
    transition: border-color 0.3s;
    margin-bottom: 0;
}

.pofm-chat-input-area textarea:focus {
    border-color: #f5ad0d;
    outline: none;
}

.pofm-chat-submit {
    height: 50px;
    width: 50px;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    flex-shrink: 0;
}

.pofm-chat-submit svg {
    margin-left: 3px;
    margin-bottom: 0px;
}

/* Image Upload UI */
.pofm-chat-image-btn {
    cursor: pointer;
    font-size: 24px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    color: #666;
    transition: color 0.3s;
    margin-bottom: 0;
}

.pofm-chat-image-btn:hover {
    color: #f5ad0d;
}

#pofm-chat-image-preview {
    font-size: 13px;
    background: #fdfdfd;
    padding: 5px 10px;
    display: inline-block;
    border-radius: 4px;
    border: 1px solid #eee;
    color: #333;
}

#pofm-chat-image-remove {
    background: none;
    border: none;
    color: #ff4d4d;
    cursor: pointer;
    font-weight: bold;
    margin-left: 8px;
    padding: 0;
}

#pofm-chat-image-remove:hover {
    color: #cc0000;
}

/* Chat Actions Menu (3 dots) */
.pofm-chat-message-row .pofm-chat-actions {
    position: relative;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    align-self: center; /* match center of bubble or flex end */
    margin-bottom: 5px;
}

.pofm-chat-message-row:hover .pofm-chat-actions,
.pofm-chat-actions.active {
    opacity: 1;
}

.pofm-chat-action-trigger {
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.pofm-chat-action-trigger:hover {
    background: #f0f0f0;
    color: #333;
}

.pofm-chat-dropdown-menu {
    position: absolute;
    bottom: 100%;
    right: 50%;
    transform: translateX(50%);
    margin-bottom: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 10;
    border: 1px solid #eee;
    padding: 5px 0;
}

.pofm-chat-actions.active .pofm-chat-dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.pofm-chat-dropdown-menu .pofm-chat-revoke-btn,
.pofm-chat-dropdown-menu .pofm-chat-delete-btn {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #d93025; /* Red for destructive action */
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.pofm-chat-dropdown-menu .pofm-chat-revoke-btn:hover,
.pofm-chat-dropdown-menu .pofm-chat-delete-btn:hover {
    background: #fff1f0;
}

/* Fix generic My Account headings */
.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
    font-size: 1.5em;
}

/* ==========================================================
   4. Login / Register Forms (Logged out state)
   ========================================================== */

/* Title adjustments */
.woocommerce>h2,
#customer_login h2 {
    margin-top: 0 !important;
    margin-bottom: 25px !important;
    color: #333 !important;
    font-size: 28px !important;
    font-weight: 600 !important;
    text-align: center !important;
    width: 100%;
}

/* Base Form Box */
.woocommerce form.login,
.woocommerce form.register {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    margin-bottom: 20px;
}

/* Container width constraint */
.woocommerce>form.login {
    max-width: 500px;
    margin: 40px auto;
    display: block;
}

/* If dual columns (Login & Register) */
#customer_login {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1000px;
    margin: 40px auto;
}

#customer_login>.u-column1,
#customer_login>.u-column2 {
    flex: 1 1 calc(50% - 20px);
    max-width: 500px;
    width: 100%;
}

/* Label styling */
.woocommerce form.login label,
.woocommerce form.register label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
}

/* Fix Password Input & Show Password Button */
.woocommerce form .password-input {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

.woocommerce form .password-input input[type="password"],
.woocommerce form .password-input input[type="text"] {
    padding-right: 50px !important;
}

.woocommerce form .show-password-input {
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #f5ad0d !important;
    font-size: 14px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    display: block !important;
    z-index: 10 !important;
}

.woocommerce form .show-password-input::after {
    color: #f5ad0d !important;
}

.woocommerce form .show-password-input:hover {
    background: transparent !important;
    transform: translateY(-50%) !important;
    box-shadow: none !important;
    color: #d9960a !important;
}

/* Checkbox specific fix (remember me) */
.woocommerce form.login .woocommerce-form-login__rememberme {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 15px 0 25px;
    font-weight: normal;
    cursor: pointer;
}

.woocommerce form.login .woocommerce-form-login__rememberme input[type="checkbox"] {
    width: auto !important;
    margin: 0 !important;
    appearance: auto !important;
    -webkit-appearance: checkbox;
    accent-color: #f5ad0d;
    height: auto;
    border: none;
    background: none;
    box-shadow: none;
}

/* Standardize Login/Register Button completely */
.woocommerce form.login .woocommerce-button,
.woocommerce form.register .woocommerce-button,
.woocommerce form.login button[type="submit"],
.woocommerce form.register button[type="submit"] {
    width: 100%;
    background-color: #f5ad0d !important;
    color: #fff !important;
    border: none !important;
    padding: 14px 20px;
    height: auto;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    text-align: center;
}

.woocommerce form.login button[type="submit"]:hover,
.woocommerce form.register button[type="submit"]:hover {
    background-color: #d9960a !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 173, 13, 0.3);
}

/* Lost password link */
.woocommerce form.login .woocommerce-LostPassword {
    margin-top: 15px;
    text-align: center;
    display: block;
}

.woocommerce form.login .woocommerce-LostPassword a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.woocommerce form.login .woocommerce-LostPassword a:hover {
    color: #f5ad0d;
}

/* Responsive constraints for forms */
@media (max-width: 768px) {
    #customer_login {
        flex-direction: column;
        gap: 20px;
    }

    #customer_login>.u-column1,
    #customer_login>.u-column2 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .woocommerce form.login,
    .woocommerce form.register {
        padding: 25px;
    }
}