/* --- Sooduskaardid Sheets Plugin Styles v3.4.0 --- */
/* --- Streamlined Mobile-First Design (matches Sales Cards) --- */
/* --- v3.2.0: Added Activate Offer CTA button --- */
/* --- v3.3.0: Standardized button heights with SOA --- */
/* --- v3.4.0: Button differentiation (copy=outline/dashed, open=solid), WCAG contrast fix --- */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Premium 2025 Color Palette */
    --skp-card-bg: #ffffff;
    --skp-card-border: #e0e7ee;
    --skp-card-border-active: #00C896;
    --skp-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --skp-card-hover-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    
    /* Accent Colors */
    --skp-accent-color: #00C896;
    --skp-accent-darker: #00A67D;
    --skp-accent-lighter: #E6FBF5;
    
    /* Text Colors */
    --skp-text-primary: #1a2332;
    --skp-text-secondary: #5c6a7f;
    --skp-text-muted: #8b97a8;
    
    /* Code Display */
    --skp-code-color: #00A67D;
    --skp-code-bg: #f5f8fa;
    
    /* Expired States - WCAG AA compliant (4.5:1 min contrast) */
    --skp-expired-opacity: 0.7;
    --skp-expired-text: #5c6a7f;  /* Was #a8b3c0 (3.8:1 FAIL) → now 7.8:1 PASS */
    
    /* Transitions */
    --skp-transition: 0.2s ease;
}

/* === General Wrapper === */
.skp-coupons-wrapper { 
    margin: 24px auto; 
    max-width: 600px; 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; 
    color: var(--skp-text-primary); 
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

.active-coupons-container, 
.expired-coupons-wrapper { 
    display: flex;
    flex-direction: column;
    gap: 16px; 
}

/* === Card Base === */
.coupon-card {
    background: var(--skp-card-bg);
    border: 2px dashed var(--skp-card-border-active);
    border-radius: 16px;
    box-shadow: var(--skp-card-shadow);
    padding: 16px;
    transition: transform var(--skp-transition), box-shadow var(--skp-transition);
}

.coupon-card.active:hover { 
    transform: translateY(-2px); 
    box-shadow: var(--skp-card-hover-shadow);
}

.coupon-card.expired {
    border-color: var(--skp-card-border);
    border-style: dashed;
    opacity: var(--skp-expired-opacity);
}

.coupon-card.expired:hover {
    transform: none;
}

/* === Header Row (Source + Badge) === */
.coupon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.coupon-source {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--skp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coupon-source::before {
    content: '🌐 ';
    font-size: 0.7rem;
}

.coupon-source.source-user::before {
    content: '👤 ';
}

.coupon-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.coupon-badge.popular-badge {
    background: var(--skp-accent-lighter);
    color: var(--skp-accent-darker);
    border: 1px solid rgba(0, 200, 150, 0.2);
}

.coupon-badge.expired-badge {
    background: #f5f5f5;
    color: var(--skp-expired-text);
    border: 1px solid #e0e0e0;
}

/* === Code Row === */
.coupon-code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--skp-code-bg);
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.coupon-code {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--skp-code-color);
    letter-spacing: 1px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    word-break: break-all;
}

/* === Copy Button === */
/* v3.4.0: Differentiated from Open button - outline style with dashed border */
/* Visual distinction: Copy = outline/dashed, Open = solid fill */
.copy-btn {
    background: #ffffff;
    color: var(--skp-accent-color);
    border: 2px dashed var(--skp-accent-color);
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--skp-transition);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 200, 150, 0.15);
    min-height: 44px; /* Consistent tap target */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Clipboard icon before text */
.copy-btn::before {
    content: "📋";
    font-size: 0.85em;
}

.copy-btn:hover {
    background: var(--skp-accent-lighter);
    border-color: var(--skp-accent-darker);
    color: var(--skp-accent-darker);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 200, 150, 0.25);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn .copy-btn-copied { display: none; }
.copy-btn.copied .copy-btn-text { display: none; }
.copy-btn.copied .copy-btn-copied { display: inline; }
.copy-btn.copied::before { content: "✓"; }
.copy-btn.copied {
    background: var(--skp-accent-lighter);
    border-color: var(--skp-accent-color);
    border-style: solid;
    color: var(--skp-accent-darker);
}

/* === Tagline === */
.coupon-tagline {
    font-size: 0.9rem;
    color: var(--skp-text-secondary);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

/* === Footer Row (Expiry + Votes + More Info) === */
.coupon-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #eef2f6;
}

.coupon-footer-left {
    display: flex;
    align-items: center;
}

.coupon-expiry {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--skp-accent-darker);
}

.coupon-footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* === Inline Vote Buttons (Compact) === */
.vote-buttons-inline {
    display: flex;
    gap: 4px;
    align-items: center;
}

.vote-buttons-inline .vote-btn {
    background: #f5f7f9;
    border: 1px solid #e2e6eb;
    color: var(--skp-text-muted);
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--skp-transition);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.vote-buttons-inline .vote-btn .vote-count {
    font-weight: 600;
    font-size: 0.7rem;
}

.vote-buttons-inline .vote-btn:hover:not(:disabled):not(.voted) {
    background: #eef1f4;
}

.vote-buttons-inline .vote-btn.vote-up:hover:not(:disabled):not(.voted) {
    color: var(--skp-accent-color);
    border-color: var(--skp-accent-color);
}

.vote-buttons-inline .vote-btn.vote-down:hover:not(:disabled):not(.voted) {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

.vote-buttons-inline .vote-btn:disabled,
.vote-buttons-inline .vote-btn.voted {
    opacity: 0.5;
    cursor: default;
}

.vote-buttons-inline.disabled-voting .vote-btn {
    opacity: 0.4;
    cursor: default;
}

.vote-buttons-inline.loading .vote-btn {
    cursor: wait;
    opacity: 0.3;
}

/* === More Info Toggle === */
.extra-info-toggle {
    background: none;
    border: 1px solid #e2e6eb;
    color: var(--skp-text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all var(--skp-transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.extra-info-toggle:hover {
    color: var(--skp-accent-color);
    border-color: var(--skp-accent-color);
    background: var(--skp-accent-lighter);
}

.extra-info-toggle .toggle-arrow {
    font-size: 0.65rem;
    transition: transform var(--skp-transition);
}

.extra-info-toggle.open .toggle-arrow {
    transform: rotate(180deg);
}

/* === Extra Info Content === */
.extra-info-content {
    background: #f8fafb;
    padding: 14px 16px;
    margin: 12px -16px -16px -16px;
    border-radius: 0 0 14px 14px;
    border-top: 1px dashed #e0e7ee;
    font-size: 0.875rem;
    color: var(--skp-text-secondary);
    line-height: 1.6;
}

.extra-info-content p:last-child {
    margin-bottom: 0;
}

.extra-info-content .no-extra-info {
    font-style: italic;
    opacity: 0.7;
    text-align: center;
    margin: 0;
    color: var(--skp-text-muted);
}

/* === Activate Offer CTA Button (v3.2.0 NEW) === */
.coupon-cta-row {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eef2f6;
}

/* v3.3.0: Standardized height with SOA action buttons */
.coupon-activate-offer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--skp-accent-color) 0%, var(--skp-accent-darker) 100%);
    color: #fff !important;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none !important;
    transition: all var(--skp-transition);
    box-shadow: 0 2px 8px rgba(0, 200, 150, 0.25);
    min-height: 48px; /* Consistent CTA height */
}

.coupon-activate-offer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 200, 150, 0.35);
    color: #fff !important;
}

.coupon-activate-offer:active {
    transform: translateY(0);
}

.coupon-activate-offer .cta-arrow {
    font-size: 1rem;
    transition: transform var(--skp-transition);
}

.coupon-activate-offer:hover .cta-arrow {
    transform: translateX(3px);
}

/* === Expired Card Overrides === */
.coupon-card.expired .coupon-source,
.coupon-card.expired .coupon-tagline,
.coupon-card.expired .coupon-expiry,
.coupon-card.expired .extra-info-toggle {
    color: var(--skp-expired-text);
}

.coupon-card.expired .coupon-code {
    color: var(--skp-expired-text);
}

.coupon-card.expired .coupon-code-row {
    background: #f5f5f5;
}

.coupon-card.expired .copy-btn {
    background: linear-gradient(135deg, #a8b3c0 0%, #8b97a8 100%);
    box-shadow: none;
}

.coupon-card.expired .coupon-footer {
    border-top-color: #e8e8e8;
}

.coupon-card.expired .extra-info-toggle:hover {
    color: var(--skp-expired-text);
    border-color: #d0d0d0;
    background: #f5f5f5;
}

/* Expired CTA styling (v3.2.0) */
.coupon-card.expired .coupon-cta-row {
    border-top-color: #e8e8e8;
}

.coupon-card.expired .coupon-activate-offer {
    background: linear-gradient(135deg, #a8b3c0 0%, #8b97a8 100%);
    box-shadow: none;
}

.coupon-card.expired .coupon-activate-offer:hover {
    transform: none;
    box-shadow: none;
}

/* === No Active Codes CTA === */
.skp-no-active-coupons {
    background: linear-gradient(145deg, #f0fdf9 0%, #e6f7f2 100%);
    border: 1px solid rgba(0, 200, 150, 0.2);
    border-left: 4px solid var(--skp-accent-color);
    border-radius: 16px;
    padding: 28px 20px;
    margin: 16px 0;
    text-align: center;
}

.skp-no-active-coupons h3 {
    font-size: 1.25rem;
    color: var(--skp-text-primary);
    margin: 0 0 10px 0;
    font-weight: 700;
}

.skp-no-active-coupons .skp-explanation {
    font-size: 0.9rem;
    color: var(--skp-text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.skp-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.skp-cta {
    background: #fff;
    border: 1px solid #e0e7ee;
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    transition: all var(--skp-transition);
}

.skp-cta:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.skp-cta h4 {
    font-size: 1rem;
    color: var(--skp-text-primary);
    margin: 0 0 6px 0;
    font-weight: 600;
}

.skp-cta h4 .cta-icon {
    margin-right: 6px;
}

.skp-cta p {
    font-size: 0.85rem;
    color: var(--skp-text-secondary);
    margin-bottom: 14px;
    line-height: 1.5;
}

.skp-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: linear-gradient(135deg, var(--skp-accent-color) 0%, var(--skp-accent-darker) 100%);
    color: #fff !important;
    padding: 12px 20px;
    border-radius: 24px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--skp-transition);
    box-shadow: 0 2px 8px rgba(0, 200, 150, 0.25);
}

.skp-cta-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 200, 150, 0.35);
    color: #fff !important;
}

.skp-cta-button .btn-arrow {
    transition: transform var(--skp-transition);
}

.skp-cta-button:hover .btn-arrow {
    transform: translateX(3px);
}

.skp-cta-button.fb {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    box-shadow: 0 2px 8px rgba(45, 55, 72, 0.2);
}

.skp-cta-button.fb:hover {
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.3);
}

/* === Expired Toggle Button === */
.expired-coupons-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eef2f6;
}

.toggle-expired-codes {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 0 auto 20px auto;
    background: linear-gradient(135deg, var(--skp-accent-color) 0%, var(--skp-accent-darker) 100%);
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 200, 150, 0.25);
    transition: all var(--skp-transition);
}

.toggle-expired-codes:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 200, 150, 0.35);
}

.toggle-expired-codes .toggle-text-hide,
.toggle-expired-codes[aria-expanded="true"] .toggle-text-show {
    display: none;
}

.toggle-expired-codes[aria-expanded="true"] .toggle-text-hide {
    display: inline;
}

.toggle-expired-codes .toggle-arrow {
    display: inline-block;
    transition: transform var(--skp-transition);
    margin-left: 6px;
    font-size: 0.7rem;
}

.toggle-expired-codes[aria-expanded="true"] .toggle-arrow {
    transform: rotate(180deg);
}

/* === No Results === */
.skp-no-results-wrapper {
    text-align: center;
    padding: 20px;
}

.skp-no-results {
    color: var(--skp-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* === MOBILE RESPONSIVE (Mobile-First Already) === */

/* Tablet and up */
@media (min-width: 480px) {
    .coupon-card {
        padding: 20px;
    }
    
    .coupon-code {
        font-size: 1.5rem;
    }
    
    .coupon-code-row {
        padding: 16px 20px;
    }
    
    .skp-cta-buttons {
        flex-direction: row;
    }
    
    .skp-cta {
        flex: 1;
    }
    
    .extra-info-content {
        margin: 16px -20px -20px -20px;
        padding: 16px 20px;
    }
    
    /* CTA responsive (v3.2.0) */
    .coupon-cta-row {
        margin-top: 16px;
        padding-top: 16px;
    }
    
    .coupon-activate-offer {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
}

/* Desktop */
@media (min-width: 768px) {
    .skp-coupons-wrapper {
        margin: 30px auto;
    }
    
    .coupon-code {
        font-size: 1.65rem;
    }
    
    .coupon-footer {
        flex-wrap: nowrap;
    }
}

/* === Link Reset === */
.skp-coupons-wrapper a,
.skp-coupons-wrapper a:link,
.skp-coupons-wrapper a:visited,
.skp-coupons-wrapper a:hover,
.skp-coupons-wrapper a:active {
    text-decoration: none !important;
    border-bottom: none !important;
}