/* Modern Coupon Styles */
:root {
    --coupon-border-color: var(--secondary-color);
    --coupon-bg-color: #ffffff;
    --coupon-accent-color: var(--primary-color);
    --coupon-text-color: var(--text-color);
    --coupon-light-text: var(--light-text);
}

/* Container for each coupon */
.coupon-container {
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

/* Main coupon card */
.coupon-card {
    position: relative;
    background-color: var(--coupon-bg-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #e0e0e0;
    border-left: 4px solid var(--coupon-border-color);
    transition: all 0.3s ease;
    -webkit-print-color-adjust: exact;
}

.coupon-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

/* Logo section */
.coupon-logo {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(236, 239, 241, 0.85));
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.coupon-logo img {
    max-height: 60px;
    max-width: 80%;
    margin: 0 auto;
}

/* Content section */
.coupon-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Header with tag and actions */
.coupon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.coupon-tag-container {
    flex-grow: 1;
}

.coupon-tag {
    background-color: var(--coupon-accent-color) !important;
    color: var(--coupon-light-text) !important;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    -webkit-print-color-adjust: exact;
}

.coupon-actions {
    display: flex;
    gap: 0.5rem;
}

.coupon-actions .button {
    background-color: var(--light-accent);
    color: var(--coupon-accent-color);
    border: none;
    transition: all 0.2s ease;
}

.coupon-actions .button:hover {
    background-color: var(--coupon-accent-color);
    color: var(--coupon-light-text);
}

/* Body with offer details */
.coupon-body {
    flex-grow: 1;
    text-align: center;
    padding: 1rem 0;
}

.coupon-title {
    font-family: "Oswald", "Roboto Condensed", sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.coupon-description {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--coupon-text-color);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

/* Coupon code section */
.coupon-code-container {
    background-color: #f8f9fa;
    border: 1px dashed #ccc;
    border-radius: 4px;
    padding: 0.8rem;
    margin: 1rem auto;
    max-width: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.coupon-code-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
}

.coupon-code {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--coupon-accent-color);
    letter-spacing: 1px;
}

/* Footer with expiry and details */
.coupon-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #e0e0e0;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

.coupon-expiry {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.coupon-details {
    font-size: 0.8rem;
}

/* How to use steps */
.steps-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.step-item {
    text-align: center;
    width: 120px;
}

.step-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

/* Share modal styles */
.modal-card-head {
    background-color: var(--primary-color);
    color: white;
}

.modal-card-title {
    color: white;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

/* Highlight effect for linked coupons */
.highlight-coupon .coupon-card {
    animation: pulse 1.5s ease-in-out;
    border: 2px solid var(--secondary-color);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(198, 40, 40, 0); }
    100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0); }
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .coupon-title {
        font-size: 1.8rem;
    }

    .coupon-description {
        font-size: 1rem;
    }

    .steps-container {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .coupon-code-container {
        max-width: 100%;
    }
}

/* Print View Adjustments */
@media print {
    body:not(.printing-coupon) * {
        display: none !important;
    }

    body.printing-coupon .coupon-container {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        page-break-inside: avoid !important;
    }

    .coupon-card {
        box-shadow: none !important;
        border: 2px dashed var(--coupon-border-color) !important;
        padding: 1rem !important;
    }

    .coupon-actions, .share-coupon, .steps-container, .modal {
        display: none !important;
    }

    .coupon-tag {
        background-color: var(--coupon-accent-color) !important;
        color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .coupon-logo {
        background: none !important;
        border: none !important;
    }

    .coupon-code-container {
        border: 2px dashed #000 !important;
        background: none !important;
    }

    /* Add QR code for digital version when printing */
    .coupon-footer::after {
        content: "Scan to view digital version";
        display: block;
        margin-top: 1rem;
        font-weight: bold;
    }

    /* Ensure no extra margins or paddings are added by the document */
    html, body, main {
        margin: 0 !important;
        padding: 0 !important;
    }
}
