/*
Theme Name: Couponeon Premium Coupon Theme
Theme URI: https://couponeon.com/
Author: Antigravity Team
Description: A custom, lightweight, ultra-fast, and SEO-optimized WordPress theme for coupon affiliate websites.
Version: 1.0.0
Text Domain: couponeon
*/

/* Design Tokens & Theme Variables */
:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-accent: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --brand-primary: #7c3aed; /* Violet */
    --brand-primary-hover: #6d28d9;
    --brand-success: #10b981; /* Emerald */
    --brand-success-bg: #ecfdf5;
    --brand-success-text: #047857;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-lg: 12px;
    --radius-md: 8px;
    
    --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Dark Mode Preferences */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #0b0f19;
        --bg-card: #131c2e;
        --bg-accent: #1e293b;
        --text-primary: #f8fafc;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;
        --border-color: #1e293b;
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3);
    }
}

/* Global Resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--brand-primary-hover);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo a {
    font-size: 24px;
    font-weight: 800;
    color: var(--brand-primary);
    letter-spacing: -0.5px;
}

/* Navigation Menu System */
.header-nav-menu {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
}
.header-nav-menu li {
    display: inline-block;
}
.header-nav-menu li a {
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.15s;
}
.header-nav-menu li a:hover {
    color: var(--brand-primary);
}

@media (max-width: 767px) {
    .header-wrapper {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    .header-nav-menu {
        gap: 15px;
        justify-content: center;
        padding: 0;
        flex-wrap: wrap;
    }
}

/* Main Grid Layout */
.store-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 60px;
}
@media (min-width: 992px) {
    .store-layout {
        grid-template-columns: 8fr 4fr;
    }
}

/* Brand Banner Card */
.brand-banner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-top: 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}
@media (min-width: 768px) {
    .brand-banner {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
        gap: 30px;
    }
}

.brand-logo-container {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 150px; /* Rectangular Dimensions */
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    flex-shrink: 0;
}
.brand-logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 8px;
}

.brand-details p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.brand-stats {
    display: flex;
    gap: 15px;
    font-size: 14px;
}
.rating-stars {
    display: flex;
    align-items: center;
    gap: 5px;
}
.star {
    color: #f59e0b; /* Gold */
    font-size: 18px;
}
.star.empty {
    color: var(--text-muted);
}

@media (max-width: 767px) {
    .brand-banner {
        flex-direction: row !important;
        text-align: left !important;
        align-items: center !important;
        padding: 15px !important;
        gap: 15px !important;
    }
    .brand-logo-container {
        width: 100px !important;
        height: 60px !important;
        padding: 6px !important;
    }
    .brand-details {
        min-width: 0;
        flex-grow: 1;
    }
    .brand-title {
        font-size: 18px !important;
        margin-bottom: 4px;
        line-height: 1.2;
    }
    .brand-details p {
        display: none !important;
    }
    .brand-stats {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px 10px !important;
        font-size: 11px !important;
    }
    .brand-stats-sep {
        display: inline-block !important;
    }
    .curator-badge {
        flex-direction: column;
        text-align: center;
        padding: 15px !important;
    }
}

/* Coupon Card Styling */
.coupon-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
}
.coupon-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
@media (min-width: 768px) {
    .coupon-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}
.coupon-left {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.coupon-badge {
    background: var(--brand-success-bg);
    color: var(--brand-success-text);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 18px;
    text-align: center;
    min-width: 100px;
}
.coupon-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}
.coupon-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-muted);
}
.coupon-meta .verified {
    color: var(--brand-success);
    font-weight: 600;
}
.coupon-right {
    flex-shrink: 0;
}
.coupon-btn {
    background: var(--brand-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
    width: 100%;
    justify-content: center;
}
.coupon-btn:hover {
    background: var(--brand-primary-hover);
}
.coupon-btn-code-reveal {
    background: var(--brand-primary-hover);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    letter-spacing: 0.5px;
}

@media (max-width: 767px) {
    .coupon-card {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 12px !important;
        gap: 10px !important;
    }
    .coupon-left {
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        flex-grow: 1;
        min-width: 0;
    }
    .coupon-badge {
        min-width: 60px !important;
        width: 60px !important;
        height: 50px !important;
        font-size: 11px !important;
        padding: 4px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1.2;
        border-radius: var(--radius-md) !important;
    }
    .coupon-info {
        min-width: 0;
        flex-grow: 1;
    }
    .coupon-info h3 {
        font-size: 13px !important;
        line-height: 1.3 !important;
        margin-bottom: 3px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
    .coupon-meta {
        flex-wrap: wrap !important;
        gap: 4px 8px !important;
        font-size: 11px !important;
    }
    .coupon-right {
        flex-shrink: 0 !important;
    }
    .coupon-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
        height: 38px !important;
        width: auto !important;
        min-width: 90px !important;
    }
    .coupon-btn-code-reveal {
        display: none !important;
    }
}

/* Expired Coupon Styling */
.coupon-card.expired {
    opacity: 0.65;
}
.coupon-card.expired .coupon-badge {
    background: var(--bg-accent);
    color: var(--text-secondary);
}
.coupon-card.expired .coupon-btn {
    background: var(--text-secondary);
}

/* Star Rating Interaction Card */
.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
}
.sidebar-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
}
.rating-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.interactive-stars {
    display: flex;
    gap: 5px;
    cursor: pointer;
}
.interactive-stars .star-node {
    font-size: 30px;
    color: var(--text-muted);
    transition: color 0.15s;
}
.interactive-stars .star-node:hover,
.interactive-stars .star-node.selected {
    color: #f59e0b;
}

/* FAQ Accordion Styling */
.faq-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-top: 30px;
    box-shadow: var(--shadow-sm);
}
.faq-section h2 {
    font-size: 22px;
    margin-bottom: 20px;
}
.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}
.faq-item:last-child {
    border-bottom: none;
}
.faq-question {
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-question::after {
    content: '+';
    font-size: 20px;
    color: var(--brand-primary);
}
.faq-item.active .faq-question::after {
    content: '−';
}
.faq-answer {
    display: none;
    margin-top: 10px;
    color: var(--text-secondary);
}
.faq-item.active .faq-answer {
    display: block;
}

/* Clipboard Modal Overlay */
.coupon-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.coupon-modal.open {
    display: flex;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    padding: 35px;
    position: relative;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: scaleUp 0.25s ease-out;
}
@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}
.modal-store-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 5px;
    background: #fff;
}
.modal-store-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.modal-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
}
.code-wrapper {
    background: var(--bg-accent);
    border: 2px dashed var(--brand-primary);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-code-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--brand-primary);
}
.modal-copy-btn {
    background: var(--brand-primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
}
.modal-copy-btn.copied {
    background: var(--brand-success);
}
.modal-tip {
    font-size: 13px;
    color: var(--text-muted);
}

/* General Page Template Styling */
.page-content-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-sm);
}
.page-entry-content h2, .page-entry-content h3 {
    color: var(--text-primary);
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 800;
}
.page-entry-content p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}
.page-entry-content ul, .page-entry-content ol {
    margin-bottom: 20px;
    padding-left: 20px;
    color: var(--text-secondary);
}
.page-entry-content li {
    margin-bottom: 8px;
}

/* Homepage Features Styling */
.homepage-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.feature-icon-wrapper {
    background: var(--bg-accent);
    color: var(--brand-primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 20px;
}

/* Homepage Live Tracker Dashboard Styling */
.live-tracker-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 60px;
}
@media (min-width: 992px) {
    .live-tracker-layout {
        grid-template-columns: 1.2fr 0.8fr;
    }
}
.live-tracker-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.live-tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.live-tracker-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-success-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.live-tracker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-success);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseDot 1.6s infinite;
}
@keyframes pulseDot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Ledger List Events */
.live-activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 250px;
}
.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: var(--radius-md);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-primary);
}
.activity-item.new-fade-in {
    animation: slideInActivity 0.4s ease-out forwards;
}
@keyframes slideInActivity {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.activity-badge {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.activity-badge-savings {
    background: var(--brand-success-bg);
    color: var(--brand-success-text);
}
.activity-badge-rating {
    background: #fef3c7;
    color: #b45309;
}
.activity-desc {
    flex-grow: 1;
    line-height: 1.4;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.activity-desc strong {
    color: var(--brand-success-text);
}
.activity-star-highlight {
    color: #f59e0b;
    font-weight: 800;
}
.activity-time {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
}

/* Cumulative Savings Counter styling */
.total-savings-display-box {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
}

/* Progress bar container (chart relative to $100 limits) */
.live-progress-container {
    margin-bottom: 25px;
}
.progress-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}
.progress-track {
    background: var(--bg-accent);
    border-radius: 20px;
    height: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}
.progress-fill {
    background: linear-gradient(90deg, var(--brand-primary) 0%, #a78bfa 100%);
    width: 65%;
    height: 100%;
    border-radius: 20px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Star Rating Progress Bar Chart */
.ratings-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
}
.rating-bar-row .bar-label {
    min-width: 60px;
    color: var(--text-secondary);
}
.rating-bar-row .bar-fill-track {
    flex-grow: 1;
    height: 8px;
    background: var(--bg-accent);
    border-radius: 4px;
    overflow: hidden;
}
.rating-bar-row .bar-fill {
    height: 100%;
    background: #f59e0b;
    border-radius: 4px;
    transition: width 0.6s ease;
}
.rating-bar-row .bar-percent {
    min-width: 40px;
    text-align: right;
    color: var(--text-muted);
}

/* Custom Logo constraints for Customizer compatibility */
.custom-logo-link {
    display: inline-flex;
    align-items: center;
}
.custom-logo {
    height: 55px;
    width: auto;
    max-height: 55px;
    max-width: 220px;
    object-fit: contain;
}

/* Short Description Expandable Container */
.brand-short-desc-wrapper {
    position: relative;
    max-height: 72px; /* Approx 3 lines of text */
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}
.brand-short-desc-wrapper.expanded {
    max-height: 1000px; /* Allows full height display */
}
.brand-short-desc-toggle {
    display: none; /* hidden by default, shown by JS if text overflows */
    background: var(--brand-primary);
    color: #fff !important;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    padding: 8px 18px;
    border-radius: 20px;
    border: none;
    margin-top: 10px;
    margin-bottom: 12px;
    transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.brand-short-desc-toggle:hover {
    background: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.brand-short-desc-toggle:active {
    transform: translateY(0);
}

