/**
 * Advanced Coupons - Coupon Design System
 *
 * Professional coupon designs with glassmorphism effects,
 * adaptive sizing, and responsive layouts.
 *
 * @package AdvancedCoupons
 * @since 1.0.0
 */

/* ==========================================================================
   1. CSS CUSTOM PROPERTIES
   ========================================================================== */

:root {
    /* Typography */
    --acfw-font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --acfw-font-mono: 'Courier New', Courier, monospace;
    
    /* Coupon Sizes */
    --acfw-coupon-width-sm: 260px;
    --acfw-coupon-width-md: 280px;
    --acfw-coupon-width-lg: 320px;
    --acfw-coupon-width-xl: 340px;
    
    /* Amount Font Sizes */
    --acfw-amount-sm: 22px;
    --acfw-amount-md: 32px;
    --acfw-amount-lg: 38px;
    --acfw-amount-xl: 42px;
    --acfw-amount-xxl: 48px;
    
    /* Border Radius */
    --acfw-radius-sm: 4px;
    --acfw-radius-md: 8px;
    --acfw-radius-lg: 14px;
    --acfw-radius-xl: 20px;
    
    /* Shadows */
    --acfw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --acfw-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --acfw-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
    --acfw-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.2);
    
    /* Transitions */
    --acfw-duration: 0.2s;
    --acfw-ease: ease;
}

/* ==========================================================================
   2. COUPON BASE STYLES
   ========================================================================== */

.acfw-coupon {
    position: relative;
    font-family: var(--acfw-font-display);
    cursor: pointer;
    transition: all var(--acfw-duration) var(--acfw-ease);
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.acfw-coupon * {
    box-sizing: border-box;
}

.acfw-coupon:hover {
    transform: translateY(-4px);
}

.acfw-coupon-code {
    font-family: var(--acfw-font-mono);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ==========================================================================
   3. ADAPTIVE AMOUNT SIZING
   ========================================================================== */

.acfw-coupon-amount {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acfw-coupon-amount[data-length="short"] {
    font-size: var(--acfw-amount-xl);
}

.acfw-coupon-amount[data-length="medium"] {
    font-size: var(--acfw-amount-md);
}

.acfw-coupon-amount[data-length="long"] {
    font-size: var(--acfw-amount-sm);
}

/* ==========================================================================
   4. COMPACT MODE
   ========================================================================== */

.acfw-coupon.acfw-compact,
.acfw-narrow-container .acfw-coupon {
    width: 100%;
    min-width: auto;
    min-height: 60px;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.acfw-coupon.acfw-compact .acfw-coupon-amount,
.acfw-narrow-container .acfw-coupon .acfw-coupon-amount {
    font-size: 18px;
    white-space: nowrap;
}

.acfw-coupon.acfw-compact .acfw-coupon-code,
.acfw-narrow-container .acfw-coupon .acfw-coupon-code {
    font-size: 11px;
}

.acfw-coupon.acfw-compact .acfw-coupon-expiry,
.acfw-narrow-container .acfw-coupon .acfw-coupon-expiry {
    font-size: 10px;
}

/* Container Query */
@supports (container-type: inline-size) {
    .acfw-ac-list {
        container-type: inline-size;
    }
    
    @container (max-width: 350px) {
        .acfw-coupon {
            width: 100%;
            min-width: auto;
            min-height: 60px;
        }
        
        .acfw-coupon .acfw-coupon-amount {
            font-size: 18px;
        }
    }
}

/* ==========================================================================
   5. DESIGN: TICKET
   ========================================================================== */

.acfw-design-ticket {
    width: var(--acfw-coupon-width-lg);
    min-height: 130px;
    display: flex;
    border-radius: var(--acfw-radius-md);
    box-shadow: var(--acfw-shadow-md);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.acfw-design-ticket:hover {
    box-shadow: var(--acfw-shadow-lg);
}

.acfw-ticket-sidebar {
    width: 80px;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    border-right: 2px dashed;
    gap: 6px;
}

.acfw-discount-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    opacity: 0.6;
}

.acfw-discount-amount {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.acfw-discount-amount[data-length="medium"] {
    font-size: 20px;
}

.acfw-discount-amount[data-length="long"] {
    font-size: 15px;
}

.acfw-ticket-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px 20px;
}

.acfw-ticket-title {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.acfw-ticket-desc {
    font-size: 13px;
    font-style: italic;
    font-weight: 500;
    opacity: 0.8;
    margin-bottom: 10px;
}

.acfw-ticket-code {
    display: inline-block;
    font-family: var(--acfw-font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 5px 12px;
    border-radius: var(--acfw-radius-sm);
    align-self: flex-start;
}

.acfw-ticket-expiry {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 8px;
}

.acfw-design-ticket.acfw-compact {
    width: 100%;
    min-height: 100px;
}

.acfw-design-ticket.acfw-compact .acfw-ticket-sidebar {
    width: 60px;
    padding: 12px 6px;
}

.acfw-design-ticket.acfw-compact .acfw-discount-amount {
    font-size: 18px;
}

.acfw-design-ticket.acfw-compact .acfw-ticket-content {
    padding: 12px 14px;
}

.acfw-design-ticket.acfw-compact .acfw-ticket-title {
    font-size: 12px;
}

/* ==========================================================================
   6. DESIGN: FLAT
   ========================================================================== */

.acfw-design-flat {
    width: var(--acfw-coupon-width-sm);
    min-height: 110px;
    border-radius: var(--acfw-radius-lg);
    box-shadow: var(--acfw-shadow-md);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.acfw-design-flat:hover {
    box-shadow: var(--acfw-shadow-lg);
}

.acfw-design-flat .acfw-coupon-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px 12px;
}

.acfw-design-flat .acfw-coupon-value {
    flex-shrink: 0;
}

.acfw-design-flat .acfw-coupon-amount {
    font-size: var(--acfw-amount-lg);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.acfw-design-flat .acfw-coupon-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

.acfw-design-flat .acfw-coupon-desc {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
}

.acfw-design-flat .acfw-coupon-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 14px;
    font-size: 12px;
    opacity: 0.9;
}

.acfw-design-flat .acfw-coupon-footer svg {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    opacity: 0.7;
}

.acfw-design-flat .acfw-coupon-code,
.acfw-design-flat .acfw-coupon-expiry {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    color: inherit;
    background: transparent;
    border: none;
    padding: 0;
}

/* ==========================================================================
   7. DESIGN: CUTOUT
   ========================================================================== */

.acfw-design-cutout {
    width: var(--acfw-coupon-width-md);
    position: relative;
    border: 2px dashed;
    border-radius: var(--acfw-radius-md);
    transition: all var(--acfw-duration) var(--acfw-ease);
}

.acfw-design-cutout:hover {
    border-style: solid;
    box-shadow: var(--acfw-shadow-md);
}

.acfw-scissors {
    position: absolute;
    top: -12px;
    left: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background: inherit;
    border-radius: 50%;
}

.acfw-scissors svg {
    width: 16px;
    height: 16px;
    transform: rotate(-45deg);
}

.acfw-cutout-inner {
    padding: 20px;
}

.acfw-design-cutout .acfw-coupon-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.acfw-design-cutout .acfw-coupon-value {
    text-align: center;
    min-width: 70px;
}

.acfw-design-cutout .acfw-coupon-amount {
    font-size: var(--acfw-amount-md);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.acfw-design-cutout .acfw-coupon-amount[data-length="medium"] {
    font-size: 26px;
}

.acfw-design-cutout .acfw-coupon-amount[data-length="long"] {
    font-size: 20px;
}

.acfw-design-cutout .acfw-coupon-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    opacity: 0.7;
}

.acfw-design-cutout .acfw-coupon-desc {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    padding-top: 4px;
}

.acfw-design-cutout .acfw-coupon-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.acfw-design-cutout .acfw-coupon-code {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--acfw-radius-sm);
    letter-spacing: 0.5px;
}

.acfw-design-cutout .acfw-coupon-expiry {
    font-size: 11px;
    opacity: 0.6;
}

.acfw-design-cutout.acfw-compact {
    width: 100%;
}

.acfw-design-cutout.acfw-compact .acfw-cutout-inner {
    padding: 14px;
}

.acfw-design-cutout.acfw-compact .acfw-coupon-amount {
    font-size: 24px;
}

/* ==========================================================================
   8. DESIGN: FESTIVE
   ========================================================================== */

.acfw-design-festive {
    width: var(--acfw-coupon-width-xl);
    min-height: 160px;
    position: relative;
    border-radius: var(--acfw-radius-md);
    box-shadow: var(--acfw-shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.acfw-design-festive:hover {
    box-shadow: var(--acfw-shadow-lg);
}

.acfw-festive-main {
    padding: 20px 24px;
    margin-right: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 160px;
    box-sizing: border-box;
}

.acfw-festive-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.acfw-festive-amount {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.acfw-amount-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.acfw-amount-value[data-length="medium"] {
    font-size: 28px;
}

.acfw-amount-value[data-length="long"] {
    font-size: 22px;
}

.acfw-star {
    font-size: 16px;
    opacity: 0.7;
}

.acfw-festive-type {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.acfw-festive-desc {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 12px;
    opacity: 0.85;
}

.acfw-festive-code {
    display: inline-block;
    font-family: var(--acfw-font-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 8px 20px;
    border-radius: 6px;
    margin-bottom: 8px;
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.acfw-festive-expiry {
    font-size: 11px;
    opacity: 0.6;
}

.acfw-festive-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.acfw-sidebar-text {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    white-space: nowrap;
}

.acfw-design-festive.acfw-compact {
    width: 100%;
    min-height: 140px;
}

.acfw-design-festive.acfw-compact .acfw-festive-main {
    padding: 16px 20px;
    margin-right: 50px;
    min-height: 140px;
}

.acfw-design-festive.acfw-compact .acfw-amount-value {
    font-size: 28px;
}

.acfw-design-festive.acfw-compact .acfw-festive-sidebar {
    width: 50px;
}

/* ==========================================================================
   9. DESIGN: MINIMAL
   ========================================================================== */

.acfw-design-minimal {
    width: var(--acfw-coupon-width-sm);
    min-height: 100px;
    padding: 18px 22px;
    border: 2px solid;
    border-radius: var(--acfw-radius-lg);
    box-shadow: var(--acfw-shadow-sm);
}

.acfw-design-minimal:hover {
    box-shadow: var(--acfw-shadow-md);
}

.acfw-design-minimal .acfw-coupon-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.acfw-design-minimal .acfw-coupon-amount {
    font-size: var(--acfw-amount-sm);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.acfw-design-minimal .acfw-coupon-code {
    font-size: 10px;
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
}

.acfw-design-minimal .acfw-coupon-desc {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 10px;
}

.acfw-design-minimal .acfw-coupon-expiry {
    font-size: 11px;
    opacity: 0.7;
}

/* ==========================================================================
   10. DESIGN: GRADIENT
   ========================================================================== */

.acfw-design-gradient {
    width: var(--acfw-coupon-width-sm);
    min-height: 130px;
    padding: 22px 24px;
    border-radius: var(--acfw-radius-xl);
    text-align: center;
    background-size: 200% 200%;
    animation: acfw-gradient-shift 6s ease infinite;
    position: relative;
    overflow: hidden;
    box-shadow: var(--acfw-shadow-lg);
}

.acfw-design-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 60%);
    pointer-events: none;
}

.acfw-design-gradient:hover {
    box-shadow: var(--acfw-shadow-xl);
    animation-play-state: paused;
}

.acfw-design-gradient .acfw-coupon-amount {
    font-size: var(--acfw-amount-xxl);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    position: relative;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.acfw-design-gradient .acfw-coupon-type {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 4px;
    position: relative;
    opacity: 0.9;
}

.acfw-design-gradient .acfw-coupon-desc {
    font-size: 13px;
    font-weight: 500;
    margin-top: 10px;
    position: relative;
    opacity: 0.9;
}

.acfw-design-gradient .acfw-coupon-code {
    font-size: 11px;
    margin-top: 14px;
    padding: 8px 18px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 20px;
    display: inline-block;
    position: relative;
    color: inherit;
    border: none;
}

.acfw-design-gradient .acfw-coupon-expiry {
    font-size: 10px;
    margin-top: 8px;
    opacity: 0.75;
    position: relative;
}

@keyframes acfw-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ==========================================================================
   11. DESIGN: EMAIL
   ========================================================================== */

.acfw-design-email {
    width: var(--acfw-coupon-width-sm);
    padding: 0;
    border-radius: var(--acfw-radius-lg);
    text-align: center;
    box-shadow: var(--acfw-shadow-md);
    overflow: hidden;
}

.acfw-design-email:hover {
    box-shadow: var(--acfw-shadow-lg);
}

.acfw-design-email .acfw-coupon-header {
    padding: 28px 24px 16px;
}

.acfw-design-email .acfw-coupon-amount {
    font-size: var(--acfw-amount-xl);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

.acfw-design-email .acfw-coupon-type {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.85;
    margin-top: 6px;
}

.acfw-design-email .acfw-coupon-code-wrapper {
    padding: 0 24px 20px;
}

.acfw-design-email .acfw-coupon-code {
    font-family: var(--acfw-font-mono);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 12px 24px;
    border-radius: var(--acfw-radius-md);
    display: inline-block;
    border: none;
}

.acfw-design-email .acfw-coupon-desc {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.9;
    padding: 0 24px 16px;
}

.acfw-design-email .acfw-coupon-expiry {
    font-size: 12px;
    opacity: 0.7;
    padding: 0 24px 24px;
}

.acfw-design-email .acfw-coupon-expiry::before {
    content: "⏱ ";
}

/* ==========================================================================
   12. COUPONS LIST LAYOUT
   ========================================================================== */

.acfw-coupons-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
}

/* ==========================================================================
   13. WOOCOMMERCE PRICE STYLING
   ========================================================================== */

.acfw-coupon .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
}

.acfw-coupon .woocommerce-Price-currencySymbol {
    font-size: 0.5em;
    font-weight: 600;
    vertical-align: super;
    margin-right: 1px;
}

/* ==========================================================================
   14. RESPONSIVE DESIGN
   ========================================================================== */

@media (min-width: 768px) {
    .acfw-coupons-list {
        gap: 28px;
    }
}

@media (max-width: 782px) {
    .acfw-design-ticket,
    .acfw-design-flat,
    .acfw-design-cutout,
    .acfw-design-minimal,
    .acfw-design-gradient,
    .acfw-design-festive,
    .acfw-design-email {
        max-width: 100%;
    }
}

/* ==========================================================================
   15. PRINT STYLES
   ========================================================================== */

@media print {
    .acfw-coupon {
        display: inline-block;
        page-break-inside: avoid;
        margin: 10px;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
