/* 
 * NguyenThaiMMO Coupons Pro Styles - Refactored
 */

.ntm-coupon {
    margin: 25px 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ntm-coupon:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1);
}

/* Info Section */
.ntm-info {
    flex: 1;
    padding: 30px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ntm-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f4f9;
    color: #1a73e8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 50px;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    width: fit-content;
}

.ntm-title {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1b;
    margin: 0 0 8px 0 !important;
    line-height: 1.2;
}

.ntm-desc {
    font-size: 14px;
    color: #5f6368;
    margin: 0 0 15px 0 !important;
    line-height: 1.5;
}

.ntm-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    color: #70757a;
}

.ntm-expiry {
    color: #d93025;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Action Section */
.ntm-action {
    width: 240px;
    padding: 30px;
    background: #f8f9fa;
    border-left: 2px dashed #dadce0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 120px;
}

/* Punch holes (Góc khuyết) - Mặc định cho Standard */
.ntm-action::before,
.ntm-action::after {
    content: '';
    position: absolute;
    left: -11px;
    width: 20px;
    height: 20px;
    background: #f8f8f8;
    /* Màu nền trang web */
    border-radius: 50%;
    z-index: 10;
}

.ntm-action::before {
    top: -10px;
}

.ntm-action::after {
    bottom: -10px;
}

/* Căn chỉnh lại cho các style đặc biệt */
.style-premium .ntm-action::before,
.style-premium .ntm-action::after {
    background: #f8f8f8;
}

.style-ticket .ntm-action::before,
.style-ticket .ntm-action::after {
    background: #fff;
}

.style-modern .ntm-action::before,
.style-modern .ntm-action::after {
    display: none;
}

/* Ribbon Alignment */
.ribbon-right .ntm-info {
    order: 1;
}

.ribbon-right .ntm-action {
    order: 2;
    border-left: 2px dashed #dadce0;
    border-right: none;
}

.ribbon-left .ntm-action {
    border-left: 2px dashed #dadce0;
}

/* REVEAL BUTTON */
.ntm-coupon-btn {
    width: 100%;
    background: var(--ntm-primary, #1a73e8);
    color: var(--ntm-btn-text, #ffffff) !important;
    text-align: center;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(26, 115, 232, 0.2);
    transition: all 0.3s ease;
    border: none;
    text-decoration: none !important;
}

.ntm-coupon-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(26, 115, 232, 0.4);
}

.ntm-code-display,
.ntm-code-static {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    border: 2px dashed var(--ntm-primary, #1a73e8);
    color: var(--ntm-primary, #1a73e8);
    font-family: monospace;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.ntm-code-display.revealed {
    display: block !important;
    animation: ntmFadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ntm-code-static {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ntm-simple-code-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ntm-simple-code-value {
    overflow-wrap: anywhere;
}

.ntm-simple-copy-btn {
    margin-left: auto;
}

/* Feature D: Inline copy button ─────────────────────────────── */
.ntm-copy-btn {
    background: transparent;
    border: 1px solid var(--ntm-primary, #1a73e8);
    color: var(--ntm-primary, #1a73e8);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.ntm-copy-btn:hover {
    background: var(--ntm-primary, #1a73e8);
    color: #fff;
}
.ntm-copy-btn.ntm-copied {
    background: #00a65a;
    border-color: #00a65a;
    color: #fff;
}

.ntm-fade-out {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

/* STYLES */
.style-premium {
    background: linear-gradient(135deg, #1e1e1e 0%, #2d3436 100%);
    border: none;
}

.style-premium .ntm-title,
.style-premium .ntm-desc {
    color: #fff !important;
}

.style-premium .ntm-tag {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.style-premium .ntm-action {
    background: rgba(0, 0, 0, 0.2);
    border-left-color: rgba(255, 255, 255, 0.1);
}

.style-ticket {
    background: #f39c12;
    border: none;
}

.style-ticket .ntm-tag {
    background: #1a1a1b;
    color: #fff;
}

.style-ticket .ntm-action {
    background: rgba(0, 0, 0, 0.05);
    border-left-color: #1a1a1b;
}

/* SLEEK MINIMAL STYLE */
.style-minimal {
    border: 1px solid #ddd;
    box-shadow: none;
    border-radius: 12px;
}

.style-minimal .ntm-info {
    padding: 20px 30px;
}

.style-minimal .ntm-tag {
    background: none;
    border: 1px solid #ddd;
    color: #888;
}

.style-minimal .ntm-action {
    border-left-style: solid;
    border-left-width: 1px;
    background: #fff;
    width: 260px;
    /* Increased from 200px */
}

/* MODERN CARD STYLE */
.style-modern {
    flex-direction: column;
    width: 100%;
    max-width: 380px;
    display: flex;
    /* Changed from inline-flex to flex for block behavior */
    margin: 25px auto;
    /* Auto margin centers it */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.style-modern .ntm-info {
    flex: none;
    text-align: center;
    padding-bottom: 10px;
}

.style-modern .ntm-action {
    width: 100%;
    border-left: none;
    border-top: 1px solid #eee;
    padding: 20px;
    background: #fff;
    order: 3;
}

.style-modern .ntm-tag {
    margin: 0 auto 15px;
}


/* IMAGE CARD STYLE */
.style-image {
    flex-direction: column;
    width: 100%;
    max-width: 380px;
    display: flex;
    margin: 25px auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    background: #fff;
    padding: 0;
    /* Override padding */
    border-radius: 8px;
    /* Sharper corners */
    overflow: hidden;
}

.ntm-image-header {
    height: 180px;
    width: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: #f0f0f0;
    /* Fallback */
}

/* Ribbon inside Image */
.style-image .ntm-tag {
    position: absolute;
    top: 15px;
    left: 0;
    margin: 0;
    background: #00ca65;
    /* Green like example */
    color: #fff;
    padding: 5px 15px;
    border-radius: 0 4px 4px 0;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 13px;
}

.style-image .ntm-info {
    padding: 20px;
    text-align: left;
    flex: 1;
}

.style-image .ntm-title {
    font-size: 20px;
    margin-bottom: 10px !important;
    text-decoration: underline;
    /* Like example link style */
    text-decoration-color: #ddd;
    text-underline-offset: 4px;
}

.style-image .ntm-desc {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
}

/* Action Area - Bottom Bar for Image Card */
.style-image .ntm-action {
    width: 100%;
    padding: 0;
    min-height: 45px;
    background: #FFECB3;
    /* Yellow background for code underneath */
    border: none;
    border-top: 1px solid #eee;
    display: block;
    position: relative;
    overflow: hidden;
    /* Contain the slant */
}

/* Container for the Reveal Effect */
.ntm-image-action-row {
    position: relative;
    width: 100%;
    height: 45px;
    display: flex;
}

/* The Hidden Code (Bottom Layer) */
.ntm-image-code {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    /* Full width but text aligns right */
    height: 100%;
    background: #FFECB3;
    color: #222;
    font-family: monospace;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Text on right */
    padding-right: 20px;
    z-index: 5;
    font-size: 15px;
    box-sizing: border-box;
}

/* The Overlay Button (Top Layer) */
.ntm-image-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* Cover fully initially */
    height: 100%;
    background: #123A93;
    /* Dark Blue from demo */
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: width 0.5s ease;
    /* Smooth peel */
    overflow: hidden;
    /* Hide slant overflow */
}

/* The Slant Effect */
.ntm-image-btn:after {
    content: "";
    position: absolute;
    right: -10px;
    /* Push out slightly */
    top: 0;
    width: 30px;
    height: 100%;
    background: inherit;
    /* match button blue */
    transform: skewX(-20deg);
    z-index: 11;
    transform-origin: top;
}

/* Hover Effect: Shrink button to reveal code ONLY if not in Deal Mode */
.ntm-image-action-row:not(.ntm-deal-mode):hover .ntm-image-btn {
    width: 65%;
    /* Pull back to reveal code */
}

/* Deal Mode Specifics */
.ntm-deal-mode .ntm-image-btn {
    width: 100% !important;
    /* Always full width */
    background: #123A93;
}

.ntm-deal-mode .ntm-image-btn:hover {
    background: #0F3282;
    /* Slightly darker on hover */
}

.ntm-image-btn i {
    margin-right: 8px;
}


/* ANIMATION */
@keyframes ntmFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MOBILE RESPONSIVE */
/* MOBILE RESPONSIVE */
@media (max-width: 600px) {
    .ntm-action {
        width: 100%;
        border-left: none !important;
        border-top: 2px dashed #dadce0;
    }

    /* Fix Minimal Style Mobile Width */
    .style-minimal .ntm-action {
        width: 100% !important;
        border-top: 1px solid #ddd !important;
        border-left: none !important;
    }

    /* Fix Punch Holes for Mobile (Horizontal Divider) */
    .ntm-action::before,
    .ntm-action::after {
        width: 20px;
        height: 20px;
        top: -12px !important;
        /* Center on top border */
        bottom: auto !important;
        left: -10px !important;
        /* Left Hole */
    }

    .ntm-action::after {
        left: auto !important;
        right: -10px !important;
        /* Right Hole */
    }

    /* Hide holes for modern/minimal on mobile inside this block if needed, 
       but they are already display:none in main CSS for Modern.
       Minimal doesn't have holes defined generally. */
}

/* COUPON GRID - Modern Layout */
.ntm-coupon-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 30px;
    margin: 30px auto;
    width: 100%;
    max-width: 1200px;
}

/* Ensure Modern & Image Cards behave correctly in grid */
.ntm-coupon-grid .style-modern,
.ntm-coupon-grid .style-image {
    margin: 0 !important;
    /* Override default margin */
    flex: 1 1 300px;
    /* Base 300px, Grow, Shrink */
    max-width: 380px;
    /* Don't get too wide */
    display: flex;
    flex-direction: column;
}

/* Ensure Cards fill height equally */
.ntm-coupon-grid .style-modern .ntm-desc,
.ntm-coupon-grid .style-image .ntm-desc {
    flex-grow: 1;
}

/* PORTED SIMPLE STYLES (Exact Replica from magg) */

/* Neutralize default NTM Coupon styles for this wrapper */
.ntm-coupon.style-simple,
.ntm-coupon.style-simple-dark {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important;
    /* Override flex */
    padding: 0 !important;
    margin: 25px 0 !important;
}

/* --- Original CSS from coupon.css --- */

/* Coupon Shortcode Styles */
.maggten {
    background: #8dbce4;
    color: #fff;
    font-size: 13px;
    padding: 5px 10px 5px 10px;
    width: 140px;
    text-align: center;
    border-radius: 90px 0px 90px 0px;
    position: relative;
    margin-left: 30px;
    font-family: Arial, sans-serif;
    border-top: 5px solid #e8e8e8;
    z-index: 5;
    /* Ensure on top */
}

.magg {
    background: #fff;
    padding: 20px 40px 20px 40px;
    margin-top: -20px;
    border: 2px dashed #aaa;
    border-radius: 20px;
    /* Reduced from 40px */
    display: grid;
    grid-template-columns: 1fr 200px;
    grid-column-gap: 10px;
    font-family: Arial, sans-serif;
    position: relative;
    z-index: 1;
}

.ten-magg {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
    padding-top: 10px;
}

.dk-magg {
    font-size: 15px;
    color: #777
}

.tg-magg span {
    color: #333
}

.tg-magg {
    color: #cc1111;
    font-size: 13px;
}

.magg-ma {
    display: grid;
    place-items: center;
    grid-template-areas: "magg-ma2";
}

.magg-ma2 {
    grid-area: magg-ma2;
    width: 100%;
}

.magg-ma a {
    text-decoration: none;
    cursor: pointer;
}

.xemma {
    background: #ff5200;
    padding: 10px;
    color: #fff;
    font-size: 15px;
    width: 130px;
    text-align: center;
    border-radius: 20px 0px 0px 20px;
    border: 1px solid #ff5200;
    font-weight: bold;
    position: absolute;
    top: 0;
    left: 0;
    /* Ensure positioning */
    z-index: 2;
}

.xemma2 {
    background: #ff5200;
    padding: 10px;
    color: #fff;
    font-size: 15px;
    text-align: center;
    border-radius: 20px;
    border: 1px solid #ff5200;
    font-weight: bold;
    width: 100%;
    /* Full width for Deal */
}

.xemmagg {
    padding: 10px 20px 10px 10px;
    font-size: 15px;
    text-align: center;
    border-radius: 20px;
    border: 1px solid #999;
    font-weight: bold;
    position: unset;
    background: linear-gradient(315deg, rgba(0, 0, 0, .06) 10%, rgba(0, 0, 0, 0) 15%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, .06) 40%, rgba(0, 0, 0, .06) 60%, rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0) 85%, rgba(0, 0, 0, .06) 90%) repeat scroll 0 0/6px 6px rgba(0, 0, 0, 0);
    width: 100%;
}

/* Dark mode */
.maggtendark {
    background: #8dbce4;
    color: #fff;
    font-size: 13px;
    padding: 5px 10px 5px 10px;
    width: 140px;
    text-align: center;
    border-radius: 90px 0px 90px 0px;
    position: unset;
    margin-left: 30px;
    font-family: Arial, sans-serif;
    border-top: 5px solid #777;
    position: relative;
    /* Fix z-index */
    z-index: 5;
    /* Ensure on top */
}

.maggdark {
    background: #333e48;
    padding: 20px 40px 20px 40px;
    margin-top: -20px;
    border: 2px dashed #777;
    border-radius: 20px;
    /* Reduced from 40px */
    display: grid;
    grid-template-columns: 1fr 200px;
    grid-column-gap: 10px;
    font-family: Arial, sans-serif;
}

.ten-maggdark {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    padding-top: 10px;
}

.dk-maggdark {
    font-size: 15px;
    color: #aaa
}

.tg-maggdark span {
    color: #ccc
}

.tg-maggdark {
    color: #ff8044;
    font-size: 13px;
}

.xemmaggdark {
    padding: 10px 20px 10px 10px;
    font-size: 15px;
    text-align: center;
    border-radius: 20px;
    border: 1px solid #999;
    font-weight: bold;
    position: relative;
    background: linear-gradient(315deg, rgba(0, 0, 0, .06) 10%, rgba(0, 0, 0, 0) 15%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, .06) 40%, rgb(255 255 255 / 24%) 60%, rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0) 85%, rgba(0, 0, 0, .06) 90%) repeat scroll 0 0/6px 6px rgba(0, 0, 0, 0);
    color: #fff
}

/* Feature C: Expiry badges ──────────────────────────────────── */
.ntm-badge-expired,
.ntm-badge-expiring {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 6px;
}
.ntm-badge-expired  { background: #fde8e8; color: #b32d2e; }
.ntm-badge-expiring { background: #fff3cd; color: #856404; }

/* Dim expired coupons slightly */
.ntm-coupon.ntm-is-expired {
    opacity: 0.68;
    filter: grayscale(25%);
}
.ntm-coupon.ntm-is-expired .ntm-coupon-btn {
    background: #aaa !important;
    box-shadow: none !important;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile */
@media (max-width: 500px) {

    .maggten,
    .maggtendark {
        margin-left: 20px;
        /* Align left */
        margin-right: auto;
    }

    .magg,
    .maggdark {
        grid-template-columns: 1fr;
    }

    .xemmagg {
        text-align: left;
    }

    .xemma {
        left: 50%;
        transform: translateX(-50%);
        /* Centered on mobile? Or just left? */
        /* Original code didn't specify, leaving default */
    }

    .magg-ma {
        margin-top: 20px;
    }
}

/* WPSM Button Styles */
.single-post .post-content-area a.wpsm-button,
.post-content-area a.wpsm-button,
a.wpsm-button,
a.wpsm-button:link,
a.wpsm-button:visited,
a.wpsm-button:hover,
a.wpsm-button:active,
a.wpsm-button span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    color: #ffffff !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

a.wpsm-button-size-medium,
a.wpsm-button-size-medium span {
    padding: 12px 24px;
    font-size: 16px;
}

a.wpsm-button-color-btncolor,
a.wpsm-button-color-btncolor:link,
a.wpsm-button-color-btncolor:visited,
a.wpsm-button-color-btncolor span,
a.wpsm-button-color-btncolor:link span,
a.wpsm-button-color-btncolor:visited span {
    background: #ff5200 !important;
    color: #ffffff !important;
    border: 1px solid #ff5200 !important;
}

a.wpsm-button-color-btncolor:hover,
a.wpsm-button-color-btncolor:active,
a.wpsm-button-color-btncolor:hover span,
a.wpsm-button-color-btncolor:active span {
    background: #e04800 !important;
    border-color: #e04800 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 82, 0, 0.3);
}

a.wpsm-button.custom-wpsm-button {
    margin: 10px 0;
}

/* Button wrappers for Alignment & Layout */
.wpsm-buttons-center {
    text-align: center;
    display: block;
    width: 100%;
    margin: 15px 0;
}

.wpsm-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;
    margin: 15px 0;
    width: 100%;
}

.wpsm-buttons-row.wpsm-buttons-center {
    justify-content: center;
}
