/**
 * Coupon Block - Frontend styles
 */

/* ============================================
   Base layout
   ============================================ */

.coupon-block-wrapper {
    margin: 20px 0;
    position: relative;
    width: 100%;
}

.coupon-block-align-left {
    text-align: left;
}

.coupon-block-align-center {
    text-align: center;
}

.coupon-block-align-right {
    text-align: right;
}

/* ============================================
   Default Style (Style 1) - Clean blue-white
   ============================================ */

.coupon-block-default {
    background: #f8faff;
    border: 2px solid #4285f4;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.coupon-block-default:hover {
    box-shadow: 0 4px 20px rgba(66, 133, 244, 0.15);
    transform: translateY(-2px);
}

.coupon-block-default.coupon-expired {
    border-color: #ccc;
    background: #f5f5f5;
    opacity: 0.7;
}

/* Discount tag */
.coupon-discount-tag {
    margin-bottom: 12px;
}

.coupon-discount-badge {
    display: inline-block;
    background: #4285f4;
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.coupon-block-default .coupon-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.coupon-block-default .coupon-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Code button - default */
.coupon-block-default .coupon-code-section {
    margin-bottom: 16px;
}

.coupon-code-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #fff;
    border: 2px dashed #4285f4;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #4285f4;
    text-decoration: none;
    position: relative;
}

.coupon-code-button:hover {
    background: #4285f4;
    color: #fff;
    border-style: solid;
    transform: scale(1.02);
}

.coupon-code-button:active {
    transform: scale(0.98);
}

.coupon-code-button.coupon-expired {
    border-color: #ccc;
    color: #999;
    cursor: not-allowed;
    text-decoration: line-through;
}

.coupon-code-button.coupon-expired:hover {
    background: #fff;
    color: #999;
    transform: none;
}

.coupon-code-action {
    font-size: 13px;
    font-weight: 400;
    font-family: inherit;
}

.coupon-copied-message {
    display: inline-block;
    margin-left: 10px;
    color: #34a853;
    font-weight: 600;
    font-size: 13px;
    animation: couponFadeIn 0.3s ease;
}

/* Expiry info */
.coupon-expiry-info {
    margin-bottom: 12px;
    font-size: 13px;
}

.coupon-expired-badge {
    display: inline-block;
    background: #ea4335;
    color: #fff;
    padding: 2px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.coupon-permanent-badge {
    display: inline-block;
    background: #34a853;
    color: #fff;
    padding: 2px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.coupon-expiry-date {
    color: #888;
}

/* Terms */
.coupon-terms {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

/* ============================================
   Modern Style (Style 2) - Gradient purple-pink
   ============================================ */

.coupon-block-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 28px;
    color: #fff;
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.coupon-block-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.coupon-block-modern::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.coupon-block-modern::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.coupon-block-modern.coupon-expired {
    background: linear-gradient(135deg, #999 0%, #777 100%);
    opacity: 0.7;
    box-shadow: none;
}

.coupon-block-modern.coupon-expired:hover {
    transform: none;
    box-shadow: none;
}

/* Left side */
.coupon-modern-left {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 1;
}

.coupon-modern-discount {
    margin-bottom: 12px;
}

.coupon-modern-value {
    display: block;
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.coupon-modern-type {
    display: block;
    font-size: 16px;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 4px;
}

.coupon-modern-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.coupon-modern-description {
    font-size: 13px;
    opacity: 0.85;
    line-height: 1.5;
}

/* Right side */
.coupon-modern-right {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.coupon-block-modern .coupon-code-button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.5);
    color: #fff;
    border-radius: 50px;
    padding: 14px 28px;
    font-size: 16px;
}

.coupon-block-modern .coupon-code-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.8);
    color: #fff;
}

.coupon-modern-expiry {
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.7;
    text-align: center;
}

.coupon-modern-expiry .coupon-expiry-date {
    color: rgba(255, 255, 255, 0.7);
}

/* Footer */
.coupon-modern-footer {
    grid-column: 1 / -1;
    grid-row: 2;
    position: relative;
    z-index: 1;
}

.coupon-modern-terms {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.coupon-modern-footer .coupon-voting {
    margin-top: 8px;
}

.coupon-modern-footer .coupon-voting-label {
    color: rgba(255, 255, 255, 0.7);
}

.coupon-modern-footer .coupon-vote-btn {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.coupon-modern-footer .coupon-vote-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ============================================
   Classic Style (Style 3) - Green border
   ============================================ */

.coupon-block-classic {
    background: #fff;
    border: 3px solid #2e7d32;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.coupon-block-classic:hover {
    box-shadow: 0 4px 16px rgba(46, 125, 50, 0.15);
}

.coupon-block-classic.coupon-expired {
    border-color: #ccc;
    opacity: 0.7;
}

.coupon-block-classic.coupon-expired:hover {
    box-shadow: none;
}

/* Top serrated edge */
.coupon-classic-top,
.coupon-classic-bottom {
    height: 10px;
    background: #2e7d32;
    position: relative;
}

.coupon-block-classic.coupon-expired .coupon-classic-top,
.coupon-block-classic.coupon-expired .coupon-classic-bottom {
    background: #ccc;
}

.coupon-classic-body {
    padding: 24px;
    text-align: center;
}

.coupon-classic-discount {
    margin-bottom: 10px;
}

.coupon-classic-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
}

.coupon-classic-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
}

.coupon-classic-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Dashed separator */
.coupon-classic-divider {
    position: relative;
    margin: 16px 0;
    border-top: 2px dashed #e0e0e0;
    text-align: center;
}

.coupon-classic-scissors {
    display: inline-block;
    background: #fff;
    padding: 0 12px;
    position: relative;
    top: -14px;
}

.coupon-classic-scissors .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #2e7d32;
}

/* Classic code button */
.coupon-block-classic .coupon-code-button {
    background: #e8f5e9;
    border: 2px solid #2e7d32;
    color: #2e7d32;
    border-radius: 4px;
    font-size: 16px;
}

.coupon-block-classic .coupon-code-button:hover {
    background: #2e7d32;
    color: #fff;
}

.coupon-classic-expiry {
    margin-top: 12px;
    font-size: 12px;
}

.coupon-classic-terms {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

/* ============================================
   Voting system
   ============================================ */

.coupon-voting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 0;
}

.coupon-voting-label {
    font-size: 12px;
    color: #999;
    margin-right: 4px;
}

.coupon-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s ease;
}

.coupon-vote-btn:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.coupon-vote-btn.voted {
    background: #e8f5e9;
    border-color: #34a853;
    color: #34a853;
}

.coupon-vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.coupon-vote-icon.dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.coupon-vote-icon {
    font-size: 14px;
}

.coupon-vote-count {
    font-size: 11px;
    opacity: 0.7;
}

.coupon-vote-message {
    font-size: 12px;
    font-weight: 600;
    animation: couponFadeIn 0.3s ease;
}

/* ============================================
   No-code coupon
   ============================================ */

.coupon-code-button.coupon-no-code {
    text-decoration: none;
    font-family: inherit;
    font-weight: 600;
}

/* ============================================
   Animations
   ============================================ */

@keyframes couponFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes couponCopied {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.coupon-code-button.copied {
    animation: couponCopied 0.3s ease;
    background: #34a853 !important;
    border-color: #34a853 !important;
    color: #fff !important;
}

/* ============================================
   Mobile responsive
   ============================================ */

@media (max-width: 768px) {
    /* Default style mobile */
    .coupon-block-default {
        padding: 16px;
    }

    .coupon-block-default .coupon-title {
        font-size: 17px;
    }

    .coupon-code-button {
        padding: 12px 20px;
        font-size: 16px;
        min-height: 48px;
        width: 100%;
        justify-content: center;
    }

    /* Modern style mobile */
    .coupon-block-modern {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        padding: 20px;
        gap: 16px;
    }

    .coupon-modern-left {
        grid-column: 1;
        grid-row: 1;
        text-align: center;
    }

    .coupon-modern-right {
        grid-column: 1;
        grid-row: 2;
    }

    .coupon-modern-footer {
        grid-column: 1;
        grid-row: 3;
    }

    .coupon-modern-value {
        font-size: 36px;
    }

    .coupon-block-modern .coupon-code-button {
        width: 100%;
        justify-content: center;
    }

    /* Classic style mobile */
    .coupon-classic-body {
        padding: 16px;
    }

    .coupon-block-classic .coupon-code-button {
        width: 100%;
        justify-content: center;
    }

    /* Voting mobile */
    .coupon-voting {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .coupon-voting-label {
        margin-bottom: 4px;
    }

    .coupon-vote-btn {
        min-width: 80px;
        min-height: 40px;
        justify-content: center;
        width: 100%;
        max-width: 200px;
    }

    /* Alignment overrides */
    .coupon-block-align-left .coupon-block-default,
    .coupon-block-align-left .coupon-block-modern,
    .coupon-block-align-left .coupon-block-classic {
        margin-left: 0;
    }

    .coupon-block-align-right .coupon-block-default,
    .coupon-block-align-right .coupon-block-modern,
    .coupon-block-align-right .coupon-block-classic {
        margin-right: 0;
    }
}

/* Small phone screens */
@media (max-width: 480px) {
    .coupon-block-default,
    .coupon-block-modern,
    .coupon-block-classic {
        border-radius: 8px;
    }

    .coupon-code-button {
        font-size: 15px;
        padding: 10px 16px;
    }

    .coupon-modern-value {
        font-size: 30px;
    }

    .coupon-modern-title {
        font-size: 17px;
    }
}

/* Large screen optimizations */
@media (min-width: 1200px) {
    .coupon-block-default {
        padding: 32px;
    }

    .coupon-block-modern {
        padding: 36px;
    }

    .coupon-classic-body {
        padding: 32px;
    }
}
