/* =========================
   PTK CORE MEMBER SYSTEM
========================= */

/* =========================
   CORE CONTAINERS
========================= */
.ptk-auth-container,
.ptk-profile {
    max-width: 1080px;
    margin: 24px auto;
    padding: 0 16px;
}

.ptk-card {
    width: 100%;
    max-width: 100%;
    background: #111;
    border: 1px solid #3d3d3d;
    border-radius: 16px;
    padding: 10px;
    margin-bottom: 18px;
    color: #fff;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgb(255 197 0 / 6%);
    transition: 0.3s;
}

/* =========================================================
   PTK BUTTON SYSTEM (CLEAN VERSION)
   ใช้แทน .ptk-btn เดิมทั้งหมด
========================================================= */

/* =========================
   BASE BUTTON
========================= */
.ptk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 40px;
    padding: 9px 14px;

    border: 1px solid transparent;
    border-radius: 10px;

    background: #1f1f1f;
    color: #fff;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;

    box-sizing: border-box;
    transition: all 0.2s ease;
}

.ptk-btn:hover {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #fff;
    transform: translateY(-1px);
}

.ptk-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(196,154,61,0.18);
}

.ptk-btn:disabled,
.ptk-btn.is-disabled,
.ptk-btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
}

/* =========================
   BUTTON TYPES
========================= */

/* ปุ่มหลัก (ทอง) */
.ptk-btn-primary {
    background: #c49a3d;
    color: #111;
    border-color: #c49a3d;
}

.ptk-btn-primary:hover {
    background: #ddb257;
    border-color: #ddb257;
    color: #111;
}

/* ปุ่มรอง */
.ptk-btn-secondary {
    background: #2a2a2a;
    color: #fff;
    border-color: #383838;
}

.ptk-btn-secondary:hover {
    background: #343434;
    border-color: #4a4a4a;
}

/* ปุ่มเบา */
.ptk-btn-ghost {
    background: transparent;
    color: #e6e6e6;
    border-color: #353535;
}

.ptk-btn-ghost:hover {
    background: rgba(255,255,255,0.05);
    border-color: #4a4a4a;
}

/* ปุ่มอันตราย */
.ptk-btn-danger {
    background: #3a0d0d;
    color: #fff;
    border-color: #5a1a1a;
}

.ptk-btn-danger:hover {
    background: #5a1a1a;
    border-color: #7a2a2a;
}

/* =========================
   SIZE MODIFIERS
========================= */
.ptk-btn-sm {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 8px;
}

.ptk-btn-lg {
    min-height: 46px;
    padding: 11px 18px;
    font-size: 15px;
    border-radius: 12px;
}

.ptk-btn-block {
    width: 100%;
}

/* =========================
   PROFILE SCOPE (นิ่ง หรู)
========================= */
.ptk-profile .ptk-btn {
    background: #181818;
    border-color: #2d2d2d;
}

.ptk-profile .ptk-btn:hover {
    background: #222;
    border-color: #3a3a3a;
}

.ptk-profile .ptk-btn-primary {
    background: #c49a3d;
    color: #111;
}

/* =========================
   AMULET / SINGLE (สบายตา)
========================= */
.single-ptk_amulet .ptk-btn,
.ptk-amulet-single-wrap .ptk-btn,
.ptk-amulet-form-wrap .ptk-btn {
    background: #f6f6f3;
    color: #2a2a2a;
    border-color: #e3e3dd;
}

.single-ptk_amulet .ptk-btn:hover,
.ptk-amulet-single-wrap .ptk-btn:hover,
.ptk-amulet-form-wrap .ptk-btn:hover {
    background: #f0ede4;
    border-color: #d8ccb0;
}

.single-ptk_amulet .ptk-btn-primary,
.ptk-amulet-single-wrap .ptk-btn-primary,
.ptk-amulet-form-wrap .ptk-btn-primary {
    background: #2c2c2c;
    color: #fff;
}

.single-ptk_amulet .ptk-btn-primary:hover,
.ptk-amulet-single-wrap .ptk-btn-primary:hover,
.ptk-amulet-form-wrap .ptk-btn-primary:hover {
    background: #1f1f1f;
}

/* =========================
   NOTIFICATION ACTION
========================= */
.ptk-notification-item-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 36px;
    padding: 6px 12px;

    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;

    background: #c49a3d;
    color: #111;
    border: 1px solid #c49a3d;

    text-decoration: none;
    transition: all 0.2s ease;
}

.ptk-notification-item-link:hover {
    background: #ddb257;
}

/* =========================
   LOGOUT
========================= */
.ptk-profile-logout .ptk-btn {
    background: #111;
    border: 1px solid #333;
}

.ptk-profile-logout .ptk-btn:hover {
    background: #e11d48;
    border-color: #e11d48;
}


/* =========================
   AUTH / FORM
========================= */
.ptk-form-row {
    margin-bottom: 16px;
}

.ptk-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.ptk-form-row input,
.ptk-form-row textarea,
.ptk-form-row select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #333;
    border-radius: 10px;
    background: #1b1b1b;
    color: #fff;
    box-sizing: border-box;
}

.ptk-form-row-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ptk-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 600;
}

.ptk-alert-success {
    background: #0d3d25;
    color: #d8ffe6;
}

.ptk-alert-error {
    background: #511616;
    color: #ffdede;
}

.ptk-alert-warning {
    background: #5a4511;
    color: #fff1ca;
}

.ptk-auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.ptk-auth-tab {
    padding: 10px 14px;
    border: 1px solid #333;
    border-radius: 10px;
    background: #1b1b1b;
    color: #fff;
    cursor: pointer;
}

.ptk-auth-tab.is-active {
    background: #c49a3d;
    color: #111;
    border-color: #c49a3d;
}

.ptk-auth-panel {
    display: none;
}

.ptk-auth-panel.is-active {
    display: block;
}

.ptk-social-login-placeholder {
    margin-top: 14px;
    padding: 12px;
    border: 1px dashed #555;
    border-radius: 10px;
    color: #d6d6d6;
    font-size: 14px;
}

/* =========================
   PROFILE HEADER / COVER
========================= */
.ptk-profile-header {
    position: relative;
    overflow: hidden;
}

.ptk-profile-cover {
    position: relative;
    width: 100%;
    min-height: 160px;
    margin-bottom: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg,#1f1f1f,#2b2b2b);
    overflow: hidden;
}

.ptk-profile-cover img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.ptk-profile-header-tools {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 5;
    display: flex;
    gap: 8px;
}

/* =========================
   PROFILE SUMMARY
========================= */
.ptk-profile-summary {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.ptk-profile-avatar {
    flex: 0 0 auto;
}

.ptk-profile-avatar img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 999px;
    border: 3px solid #c49a3d;
    display: block;
}

.ptk-profile-meta {
    flex: unset;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.ptk-profile-meta h2,
.ptk-profile-meta h3 {
    margin: 0 0 6px;
    line-height: 1.3;
}

.ptk-profile-meta p {
    margin: 0 0 8px;
    line-height: 1.6;
}

.ptk-profile-badge {
    margin-bottom: 8px;
}

.ptk-profile-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.ptk-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ptk-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    text-decoration: none;
    color: #fff;
}

.ptk-social-facebook { background: #1877f2; }
.ptk-social-youtube { background: #ff0000; }
.ptk-social-line { background: #06c755; }

.ptk-social-link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* =========================
   BADGES
========================= */
.ptk-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.ptk-badge-free {
    background: #343434;
    color: #fff;
}

.ptk-badge-vip {
    background: #c49a3d;
    color: #111;
}

.ptk-badge-trusted {
    background: #1f7a53;
    color: #fff;
}

/* =========================
   PROFILE TABS
========================= */
.ptk-profile-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-bottom: 20px;
}

.ptk-profile-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    transition: 0.2s;
}

.ptk-profile-tab:hover {
    background: #3a3420;
    border-color: #444;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.ptk-profile-tab.is-active {
    background: #c49a3d;
    color: #111;
    border-color: #c49a3d;
}

.ptk-profile-tabs a.ptk-profile-tab {
    box-sizing: border-box;
    flex: 0 0 calc(25% - 8px);
    max-width: calc(25% - 8px);
    min-height: 42px;
    text-align: center;
}

.ptk-profile-tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.ptk-tab-label {
    display: inline-block;
    line-height: 1.2;
    white-space: nowrap;
}

/* tab colors */
.ptk-tab-dashboard { background: #1f2937; }
.ptk-tab-amulets { background: #7c2d12; }
.ptk-tab-my_chats { background: #8b0073; }
.ptk-tab-following { background: #065f46; }
.ptk-tab-posts { background: #4c1d95; }
.ptk-tab-notifications { background: #7f1d1d; }
.ptk-tab-starred { background: #b45309; }
.ptk-tab-dream_history { background: #0e7490; }
.ptk-tab-info { background: #374151; }
.ptk-tab-favorites { background: #9f1239; }

/* =========================
   CHAT BADGE ON TAB
========================= */
.ptk-profile-tabs a.ptk-profile-tab .ptk-chat-badge-target {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    white-space: nowrap;
}

.ptk-profile-tabs a.ptk-profile-tab .ptk-chat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    margin-left: 2px;
    flex: 0 0 auto;
}

.ptk-profile-tabs a.ptk-profile-tab .ptk-chat-badge-target::after {
    content: "";
    width: 8px;
    height: 8px;
    background: #ff1a1a;
    border-radius: 50%;
    position: absolute;
    top: 1px;
    right: -6px;
    box-shadow: 0 0 6px rgba(255,0,0,0.6);
}

.ptk-profile-tabs a.ptk-profile-tab .ptk-chat-badge-target[data-unread-count="0"] .ptk-chat-badge,
.ptk-profile-tabs a.ptk-profile-tab .ptk-chat-badge-target[data-unread-count="0"]::after {
    display: none;
}

@keyframes ptk-dot-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes ptk-badge-breath {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.ptk-profile-tabs a.ptk-profile-tab .ptk-chat-badge-target:not([data-unread-count="0"])::after {
    animation: ptk-dot-pulse 1.6s infinite ease-in-out;
}

.ptk-profile-tabs a.ptk-profile-tab .ptk-chat-badge-target:not([data-unread-count="0"]) .ptk-chat-badge {
    animation: ptk-badge-breath 2.2s infinite ease-in-out;
}

/* =========================
   LIST / GRID / MEDIA
========================= */
.ptk-social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap: 14px;
}

.ptk-list {
    display: grid;
    gap: 12px;
}

.ptk-media-field {
    display: grid;
    gap: 12px;
}

.ptk-media-preview {
    min-height: 120px;
    border: 1px dashed #444;
    border-radius: 12px;
    background: #171717;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
}

.ptk-media-preview img {
    max-width: 100%;
    max-height: 220px;
    display: block;
    border-radius: 10px;
}

.ptk-media-placeholder {
    color: #bdbdbd;
    font-size: 14px;
}

.ptk-media-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================
   DASHBOARD
========================= */
.ptk-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.ptk-stat-card {
    display: block;
    background: #171717;
    border: 1px solid #2f2f2f;
    border-radius: 16px;
    padding: 14px;
    text-decoration: none;
}

.ptk-stat-label {
    margin-bottom: 6px;
    line-height: 1.4;
    font-size: 14px;
    color: #d2d2d2;
}

.ptk-stat-value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: #19d7ce;
}

.ptk-dashboard-sections {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 18px;
    width: 100%;
}

.ptk-dashboard-sections > .ptk-card {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

/* =========================
   POSTS / STATUS
========================= */
.ptk-post-status-card {
    border-color: #343434;
}

.ptk-post-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    flex-wrap: wrap;
}

.ptk-post-main {
    min-width: 0;
    flex: 1 1 auto;
}

.ptk-post-main a,
.ptk-post-main span,
.ptk-post-main strong {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    display: block;
    line-height: 1.4;
}

.ptk-post-badge-wrap {
    flex: 0 0 auto;
    white-space: nowrap;
    opacity: 0.75;
}

.ptk-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.ptk-status-pending {
    background: #5a4511;
    color: #fff1ca;
}

.ptk-status-draft {
    background: #343434;
    color: #fff;
}

.ptk-status-publish {
    background: #0d3d25;
    color: #d8ffe6;
}

/* =========================
   NOTIFICATION BELL / DROPDOWN
========================= */
.ptk-notification-bell-wrap {
    position: relative;
    display: inline-block;
}

.ptk-notification-bell {
    position: relative;
    width: 40px;
    height: 40px;
    min-width: 46px;
    min-height: 46px;
    border: 1px solid #333;
    border-radius: 999px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: all 0.2s ease;
}

.ptk-notification-bell:hover {
    background: rgba(0,0,0,0.8);
    transform: translateY(-1px);
}

.ptk-bell-icon {
    font-size: 18px;
    line-height: 1;
}

.ptk-bell-count,
.ptk-noti-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ptk-notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-width: calc(100vw - 40px);
    background: #111;
    border: 1px solid #2f2f2f;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0,0,0,.35);
    z-index: 9999;
    overflow: hidden;
}

.ptk-notification-dropdown-head,
.ptk-notification-dropdown-foot {
    padding: 14px 16px;
    background: #171717;
    border-bottom: 1px solid #2a2a2a;
}

.ptk-notification-dropdown-foot {
    border-top: 1px solid #2a2a2a;
    border-bottom: 0;
}

.ptk-notification-dropdown-foot a {
    color: #fff;
    text-decoration: none;
}

.ptk-notification-dropdown-list {
    max-height: 360px;
    overflow-y: auto;
}

.ptk-notification-item {
    padding: 14px 16px;
    border-bottom: 1px solid #232323;
}

.ptk-notification-item.is-unread,
.ptk-notification.is-unread {
    background: #16120a;
    border-color: #c49a3d;
}

.ptk-notification-item-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.ptk-notification-item-message {
    color: #dedede;
    font-size: 14px;
    margin-bottom: 8px;
}

.ptk-notification-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.ptk-notification-empty {
    padding: 18px 16px;
    color: #ddd;
}

/* =========================
   FAVORITE TOGGLE
========================= */
.ptk-favorite-toggle.is-active {
    background: #1f7a53;
    color: #fff;
}

/* =========================
   DREAM HISTORY
========================= */
.ptk-dream-history-group {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
}

.ptk-dream-history-group-title {
    margin: 0;
    font-size: 20px;
    color: #f0d28b;
}

.ptk-dream-history-card {
    display: grid;
    gap: 8px;
}

.ptk-dream-history-card.is-starred {
    border-color: #c49a3d;
}

.ptk-dream-history-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ptk-dream-history-date {
    color: #d6d6d6;
    font-size: 14px;
}

.ptk-dream-history-head {
    color: #f0d28b;
}

.ptk-dream-history-dream {
    color: #fff;
    line-height: 1.65;
}

.ptk-dream-history-result {
    color: #e8e8e8;
    line-height: 1.65;
}

.ptk-dream-history-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ptk-history-star-btn,
.ptk-history-delete-btn {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid #333;
    background: #1b1b1b;
    color: #fff;
    cursor: pointer;
}

.ptk-history-delete-btn {
    border-color: #5a2a2a;
}

.ptk-dream-history-saved-numbers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ptk-saved-number-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #1f7a53;
    color: #fff;
    font-weight: 700;
}

/* =========================
   LOGOUT
========================= */
.ptk-logout-btn {
    white-space: nowrap;
}

.ptk-profile-logout {
    margin-top: 25px;
    text-align: left;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 860px) {
    .ptk-dashboard-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ptk-profile {
        padding-left: 0;
        padding-right: 0;
    }

    .ptk-profile-tabs a.ptk-profile-tab {
        flex: 0 0 calc(50% - 5px);
        max-width: calc(50% - 5px);
    }

    .ptk-profile-avatar img {
        width: 68px;
        height: 68px;
    }

    .ptk-profile-summary {
        gap: 12px;
    }

    .ptk-dashboard-grid {
        gap: 10px;
    }

    .ptk-stat-card {
        padding: 12px;
    }

    .ptk-stat-value {
        font-size: 20px;
    }

    .ptk-list .ptk-card {
        padding: 12px;
    }

    .ptk-post-row {
        min-height: 44px;
    }

    .ptk-profile-meta {
        flex: unset;
        min-width: 0;
        margin: 0;
        padding: 0;
    }
}

@media (max-width: 640px) {
    .ptk-profile-summary {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .ptk-btn {
        min-height: 38px;
        padding: 8px 12px;
        font-size: 14px;
    }

    .ptk-btn-lg {
        min-height: 42px;
        padding: 10px 14px;
    }
}

@media (min-width: 769px) {
    .ptk-profile {
        max-width: 920px;
        margin: 0 auto;
    }
}

/* =========================================================
   PTK NOTIFICATION MODAL UI (FINAL)
   - ใช้กับกระดิ่งแบบ Popup / Modal
   - แทนชุด Bell dropdown เดิม
========================================================= */

.ptk-notification-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  padding: 88px 12px 24px !important;
  box-sizing: border-box !important;
}

.ptk-notification-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,0.72) !important;
  backdrop-filter: blur(4px);
}

.ptk-notification-modal-box {
  position: relative !important;
  z-index: 2 !important;
  width: min(92vw, 860px) !important;
  max-height: calc(100vh - 120px) !important;
  margin: 0 auto !important;
  background: #111 !important;
  border: 1px solid rgba(196,154,61,0.35) !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 70px rgba(0,0,0,0.68) !important;
  overflow: hidden !important;
}

.ptk-notification-modal-close {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  z-index: 5 !important;
  width: 34px !important;
  height: 34px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #1f1f1f !important;
  color: #fff !important;
  font-size: 24px !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

.ptk-notification-modal-close:hover {
  background: #3a0d0d !important;
}

/* =========================
   MODAL CONTENT
========================= */

.ptk-notification-modal .ptk-notification-dropdown {
  display: block !important;
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  width: 100% !important;
  max-width: none !important;
  background: #111 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.ptk-notification-modal .ptk-notification-dropdown-head,
.ptk-notification-modal .ptk-notification-dropdown-foot {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: #181818 !important;
  color: #f5d061 !important;
  border-color: rgba(196,154,61,0.25) !important;
}

.ptk-notification-modal .ptk-notification-dropdown-head {
  padding: 14px 46px 14px 16px !important;
}

.ptk-notification-modal .ptk-notification-dropdown-list {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-height: calc(100vh - 260px) !important;
  overflow-y: auto !important;
  background: #111 !important;
}

.ptk-notification-modal .ptk-notification-item {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  padding: 14px 16px !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  background: #111 !important;
  transition: all 0.2s ease;
}

.ptk-notification-modal .ptk-notification-item:hover {
  background: #1a1a1a !important;
}

.ptk-notification-modal .ptk-notification-item.is-unread {
  background: #18140b !important;
  border-left: 3px solid #c49a3d !important;
}

.ptk-notification-modal .ptk-notification-item-title {
  color: #f5d061 !important;
  font-weight: 700;
}

.ptk-notification-modal .ptk-notification-item-message,
.ptk-notification-modal .ptk-notification-empty {
  color: #f3f3f3 !important;
}

/* =========================
   MODAL BUTTONS
========================= */

.ptk-notification-modal .ptk-notification-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 10px !important;
}

.ptk-notification-modal .ptk-notification-actions form {
  margin: 0 !important;
}

.ptk-notification-modal .ptk-notification-item-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 36px !important;
  padding: 7px 14px !important;
  border-radius: 10px !important;
  background: #c49a3d !important;
  color: #111 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  border: 1px solid #e0b24d !important;
  transition: all 0.2s ease;
}

.ptk-notification-modal .ptk-notification-item-link:hover {
  background: #f5d061 !important;
  color: #111 !important;
}

.ptk-notification-modal .ptk-btn-danger {
  min-height: 36px !important;
  padding: 7px 14px !important;
  border-radius: 10px !important;
  background: #3a0d0d !important;
  color: #fff !important;
  border: 1px solid #7a1f1f !important;
  font-size: 13px !important;
  transition: all 0.2s ease;
}

.ptk-notification-modal .ptk-btn-danger:hover {
  background: #5a1a1a !important;
}

/* =========================
   MODAL FOOTER
========================= */

.ptk-notification-modal .ptk-notification-dropdown-foot {
  display: flex !important;
  gap: 8px !important;
  padding: 12px !important;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
}

.ptk-notification-modal .ptk-notification-dropdown-foot a {
  flex: 1;
  display: block;
  text-align: center;
  padding: 8px;
  border-radius: 10px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.ptk-notification-modal .ptk-notification-dropdown-foot a:last-child {
  background: #c49a3d;
  color: #111;
  font-weight: 700;
}

.ptk-notification-modal .ptk-notification-dropdown-foot a:not(:last-child) {
  background: #1a1a1a;
  color: #ccc;
}

.ptk-notification-modal .ptk-notification-dropdown-foot a:hover {
  transform: translateY(-1px);
}

/* =========================
   MODAL OPEN STATE
========================= */

html.ptk-notification-modal-open,
body.ptk-notification-modal-open {
  overflow: hidden !important;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 480px) {
  .ptk-notification-modal {
    padding: 92px 10px 18px !important;
  }

  .ptk-notification-modal-box {
    width: 94vw !important;
    max-height: calc(100vh - 120px) !important;
  }

  .ptk-notification-modal .ptk-notification-dropdown-list {
    max-height: calc(100vh - 260px) !important;
  }

  .ptk-notification-modal .ptk-notification-actions {
    flex-direction: column !important;
  }

  .ptk-notification-modal .ptk-notification-actions,
  .ptk-notification-modal .ptk-notification-actions form,
  .ptk-notification-modal .ptk-notification-actions .ptk-btn,
  .ptk-notification-modal .ptk-notification-item-link {
    width: 100% !important;
  }

  .ptk-notification-modal .ptk-notification-dropdown-foot {
    flex-direction: column !important;
  }
}

/* เผื่อมี admin bar */
body.admin-bar .ptk-notification-modal {
  padding-top: 120px !important;
}

/* =========================================================
   PROFILE NOTIFICATION UI
   - ใช้กับแท็บโปรไฟล์
   - ไม่เกี่ยวกับกระดิ่ง modal
========================================================= */

.ptk-profile-panel .ptk-notification {
  border: 0 !important;
  box-shadow: none !important;
  background: #111 !important;
  border-radius: 14px !important;
}

.ptk-profile-panel .ptk-notification.is-unread {
  border: 0 !important;
  box-shadow: inset 4px 0 0 rgba(196,154,61,0.85) !important;
  background: #18140b !important;
}

.ptk-profile-panel .ptk-notification strong {
  display: block;
  padding-bottom: 6px;
  margin-bottom: 6px;
  color: #f5d061 !important;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ptk-profile-panel .ptk-notification p {
  margin-top: 0;
  margin-bottom: 6px;
  color: #f4f4f4 !important;
}

.ptk-profile-panel .ptk-notification small {
  display: block !important;
  margin-top: 4px !important;
  color: rgba(255,255,255,0.62) !important;
  opacity: 0.7;
}

.ptk-profile-panel .ptk-card h3 {
  position: relative;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.ptk-profile-panel .ptk-card h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background: #c49a3d;
  border-radius: 2px;
}

.ptk-profile-panel .ptk-notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ptk-profile-panel .ptk-notification-actions form {
  margin: 0;
}

.ptk-profile-panel .ptk-notification-open-btn {
  background: #c49a3d;
  color: #111;
  border: 1px solid #e0b24d;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.ptk-profile-panel .ptk-notification-open-btn:hover {
  background: #f5d061;
  color: #111;
}

.ptk-profile-panel .ptk-notification-delete-btn {
  background: #3a0d0d;
  color: #fff;
  border: 1px solid #7a1f1f;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.ptk-profile-panel .ptk-notification-delete-btn:hover {
  background: #5a1a1a;
  color: #fff;
}

@media (max-width: 480px) {
  .ptk-profile-panel .ptk-notification-actions {
    flex-direction: column;
  }

  .ptk-profile-panel .ptk-notification-actions,
  .ptk-profile-panel .ptk-notification-actions form,
  .ptk-profile-panel .ptk-notification-actions .ptk-btn {
    width: 100%;
  }
}

.ptk-notification-modal.is-hidden {
  display: none !important;
}

/* =========================================================
   PTK NOTIFICATION MODAL ENHANCEMENT
   - LOCK SCROLL (กันหน้าหลักเลื่อน)
   - SMOOTH OPEN/CLOSE ANIMATION
========================================================= */

/* 🔒 ล็อก scroll ตอน modal เปิด */
html.ptk-notification-modal-open {
  overflow: hidden;
  touch-action: none;
}

/* 🎬 animation ตอนเปิด/ปิด */
.ptk-notification-modal-box {
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.25s ease;
}

/* ตอน modal เปิด */
.ptk-notification-modal[aria-hidden="false"] .ptk-notification-modal-box {
  transform: translateY(0);
  opacity: 1;
}

/* =========================================================
   NOTIFICATION READ STATE
========================================================= */

.ptk-notification-item.is-read {
  opacity: 0.72;
}

.ptk-notification-item.is-read .ptk-notification-item-title {
  color: #d6d6d6 !important;
}

.ptk-notification-item.is-read::before {
  content: "อ่านแล้ว";
  display: inline-flex;
  margin-bottom: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #14532d;
  color: #bbf7d0;
  font-size: 11px;
}

/* =========================================================
   PTK NOTIFICATION MODAL UX POLISH
   - เพิ่มความลื่น
   - กัน scroll หลุด
   - animation premium
   - mobile ใช้พื้นที่ดีขึ้น
========================================================= */

/* 🚀 Smooth scroll มือถือ/คอม */
.ptk-notification-modal .ptk-notification-dropdown-list {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

/* 🎬 Premium open animation */
.ptk-notification-modal-box {
  transform: translateY(24px) scale(0.98);
  opacity: 0;
  transition: all 0.28s cubic-bezier(.22,.61,.36,1);
}

/* 🎬 Active modal state */
.ptk-notification-modal[aria-hidden="false"] .ptk-notification-modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* 📱 Mobile / modal spacing refinement */
.ptk-notification-modal {
  padding: 72px 12px 20px !important;
}

/* 🖱️ Item hover + smooth interaction */
.ptk-notification-modal .ptk-notification-item {
  transition: background 0.2s ease, transform 0.15s ease;
}

/* 📱 Tap feedback */
.ptk-notification-modal .ptk-notification-item:active {
  transform: scale(0.98);
}

/* =========================================================
   NOTIFICATION PAGINATION UI
========================================================= */

.ptk-notification-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #181818;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.ptk-notification-pager button {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #1a1a1a;
  border: 1px solid rgba(196,154,61,0.4);
  color: #f5d061;
  cursor: pointer;
}

.ptk-notification-pager button:hover:not(:disabled) {
  background: #c49a3d;
  color: #111;
}

.ptk-notification-pager button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.ptk-page-info {
  font-size: 13px;
  color: #ccc;
  white-space: nowrap;
}

/* =========================================================
   PROFILE NOTIFICATION ACTION FIX (FINAL)
   - แก้ปุ่ม เปิดดู / ลบ ติดกัน + ระดับเท่ากัน
========================================================= */

.ptk-profile-panel .ptk-notification-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px !important;
  margin-top: 12px !important;
}

.ptk-profile-panel .ptk-notification-actions > * {
  margin: 0 0 6px 0 !important;
}

.ptk-profile-panel .ptk-notification-actions form {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 0 6px 0 !important;
}

.ptk-profile-panel .ptk-notification-actions a,
.ptk-profile-panel .ptk-notification-actions .ptk-btn,
.ptk-profile-panel .ptk-notification-actions button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 14px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

@media (max-width: 480px) {
  .ptk-profile-panel .ptk-notification-actions {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .ptk-profile-panel .ptk-notification-actions > *,
  .ptk-profile-panel .ptk-notification-actions form,
  .ptk-profile-panel .ptk-notification-actions a,
  .ptk-profile-panel .ptk-notification-actions .ptk-btn,
  .ptk-profile-panel .ptk-notification-actions button {
    width: 100% !important;
  }
}

/* =========================================================
   PROFILE NOTIFICATION READ STATE (FIX REAL ISSUE)
========================================================= */

.ptk-profile-panel .ptk-notification.is-read {
  opacity: 0.72;
  background: #111 !important;
}

.ptk-profile-panel .ptk-notification.is-read strong {
  color: #d6d6d6 !important;
}

.ptk-profile-panel .ptk-notification.is-read::before {
  content: "อ่านแล้ว";
  display: inline-flex;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #14532d;
  color: #bbf7d0;
  font-size: 11px;
  font-weight: 700;
}

/* =========================================================
   PTK NOTIFICATION MODAL - THEME BOTTOM NAV COMPAT FIX
   - กันปุ่มล่างของ modal โดน bottom nav บัง
========================================================= */

@media (max-width: 860px) {
  .ptk-notification-modal {
    padding-top: 72px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    padding-bottom: calc(var(--ptk-bottom-nav-h, 64px) + 28px + env(safe-area-inset-bottom)) !important;
  }

  .ptk-notification-modal-box {
    max-height: calc(
      100dvh - 72px - var(--ptk-bottom-nav-h, 64px) - 38px - env(safe-area-inset-bottom)
    ) !important;
  }

  .ptk-notification-modal .ptk-notification-dropdown-list {
    max-height: calc(
      100dvh - 72px - var(--ptk-bottom-nav-h, 64px) - 220px - env(safe-area-inset-bottom)
    ) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}


/* =========================================================
   FIX WORDPRESS MEDIA MODAL CONTRAST
========================================================= */

.media-modal,
.media-modal-content,
.media-frame,
.media-frame-content,
.attachments-browser,
.media-toolbar,
.media-sidebar,
.attachment-details {
    background: #ffffff !important;
    color: #111111 !important;
}

/* title */
.media-frame-title h1,
.media-modal h1,
.media-modal h2,
.media-modal h3,
.media-modal label,
.media-modal .media-menu-item {
    color: #111111 !important;
}

/* dropdown / search */
.media-modal select,
.media-modal input[type="search"],
.media-modal input[type="text"] {
    background: #ffffff !important;
    color: #111111 !important;
    border: 1px solid #cfcfcf !important;
}

/* dropdown option */
.media-modal select option {
    background: #ffffff !important;
    color: #111111 !important;
}

/* tabs */
.media-router .media-menu-item,
.media-router .media-router-item {
    color: #111111 !important;
}

/* active tab */
.media-router .active,
.media-router .media-menu-item.active {
    color: #000000 !important;
    font-weight: 700 !important;
}

/* sidebar text */
.media-sidebar-content,
.attachment-info,
.attachment-details label,
.setting span {
    color: #111111 !important;
}

/* buttons */
.media-modal .button,
.media-modal .button-secondary {
    color: #111111 !important;
}

.media-modal .button-primary {
    background: #111111 !important;
    border-color: #111111 !important;
    color: #ffffff !important;
}

