/* ==========================================
   WP COUPONS PRO - FRONTEND STYLES
   Version: 2.8.1 (Side-by-Side Scratch Layout)
   ========================================== */

/* ------------------------------------------
   1. Wrapper & Grid Layout
   ------------------------------------------ */
.wcp-wrapper { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px; 
}

.wcp-grid { 
    display: grid; 
    gap: 24px; 
    margin-top: 20px; 
}

/* ------------------------------------------
   2. Filter Bar
   ------------------------------------------ */
.wcp-filter-bar { 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
    border-bottom: 2px solid #eee; 
    padding-bottom: 15px; 
    margin-bottom: 20px;
}

.wcp-filter-btn { 
    background: none; 
    border: none; 
    padding: 8px 16px; 
    font-size: 16px; 
    font-weight: 600; 
    color: #555; 
    cursor: pointer; 
    border-radius: 20px; 
    transition: 0.3s; 
}

.wcp-filter-btn:hover { background: #f0f0f0; }
.wcp-filter-btn.active { background: #ff5722; color: white; }
.wcp-filter-btn span { font-weight: 400; opacity: 0.8; }

/* ------------------------------------------
   3. Coupon Card
   ------------------------------------------ */
.wcp-card { 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); 
    border: 1px solid #eaeaea; 
    overflow: hidden; 
    position: relative; 
    transition: transform 0.2s, box-shadow 0.2s; 
    display: flex; 
    flex-direction: column; 
}

.wcp-card:hover { transform: translateY(-4px); box-shadow: 0 10px 15px rgba(0,0,0,0.1); }

.wcp-card-header { padding: 15px 15px 0; display: flex; justify-content: space-between; align-items: center; }
.wcp-type-badge { padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: white; }
.type-deal { background: #ff5722; }
.type-code { background: #2196f3; }
.type-reward { background: #9c27b0; }
.type-sale { background: #4caf50; }
.wcp-expiry-badge { font-size: 12px; color: #d32f2f; font-weight: 600; }

.wcp-card-body { padding: 15px; flex-grow: 1; text-align: center; }
.wcp-store-logo { width: 60px; height: 60px; margin: 0 auto 10px; border-radius: 50%; overflow: hidden; border: 2px solid #f0f0f0; }
.wcp-store-logo img { width: 100%; height: 100%; object-fit: cover; }
.wcp-store-name { font-size: 18px; margin: 0 0 5px; color: #333; }
.wcp-discount { font-size: 24px; font-weight: 800; color: #ff5722; margin-bottom: 10px; }
.wcp-description { font-size: 14px; color: #666; margin: 0; line-height: 1.5; }

.wcp-card-footer { padding: 15px; border-top: 1px solid #f0f0f0; display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* ------------------------------------------
   4. Buttons (Get Deal & Terms)
   ------------------------------------------ */
.wcp-get-deal-btn { display: block; text-align: center; padding: 12px; border-radius: 8px; font-weight: 700; text-decoration: none; font-size: 16px; border: none; cursor: pointer; transition: 0.3s; background: #ff5722; color: white; width: 100%; box-sizing: border-box; }
.wcp-get-deal-btn:hover { background: #e64a19; }
.wcp-terms-btn { background: none; border: none; color: #888; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 0; transition: color 0.2s; }
.wcp-terms-btn:hover { color: #555; }

/* ------------------------------------------
   5. Featured Ribbon
   ------------------------------------------ */
.wcp-featured-ribbon { position: absolute; top: 15px; left: -30px; background: #ffc107; color: #333; padding: 4px 35px; font-size: 12px; font-weight: 700; transform: rotate(-45deg); z-index: 10; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

/* ------------------------------------------
   6. Scratch Card & Copy Button (SIDE-BY-SIDE LAYOUT)
   ------------------------------------------ */
.wcp-scratch-wrapper {
    display: flex;
    flex-direction: row; /* Changed from column to row */
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 0;
    width: 100%;
}

.wcp-scratch-container {
    position: relative;
    width: 200px; /* Fixed width for side-by-side */
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    background: #fff;
    border: 2px dashed #ddd;
    flex-shrink: 0;
}

.wcp-scratch-reveal {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center; z-index: 1;
    background: repeating-linear-gradient(45deg, #f8f9fa, #f8f9fa 10px, #e9ecef 10px, #e9ecef 20px);
}

.wcp-scratch-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px; font-weight: bold; color: #333; letter-spacing: 1px;
    background: #fff; padding: 5px 15px; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wcp-scratch-canvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2;
    cursor: pointer; touch-action: none;
}

.wcp-scratch-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex-grow: 1;
}

.wcp-copy-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #28a745; color: white; border: none; padding: 12px 16px;
    border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600;
    transition: all 0.2s ease; box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
    width: 100%; max-width: 160px;
}

.wcp-copy-btn:hover { background: #218838; transform: translateY(-1px); box-shadow: 0 4px 6px rgba(40, 167, 69, 0.4); }
.wcp-copy-btn.copied { background: #6c757d; box-shadow: none; transform: none; }
.wcp-copy-icon { font-size: 16px; }

.wcp-scratch-hint { font-size: 11px; color: #888; margin: 0; font-style: italic; white-space: nowrap; }

/* ------------------------------------------
   7. Statistics Bar
   ------------------------------------------ */
.wcp-stats-bar {
    display: flex; justify-content: space-around; font-size: 12px; color: #888;
    margin-top: 10px; border-top: 1px solid #eee; padding-top: 10px; width: 100%;
}
.wcp-stats-bar span { display: flex; align-items: center; gap: 4px; font-weight: 500; }

/* ------------------------------------------
   8. Modal (Terms & Conditions)
   ------------------------------------------ */
.wcp-modal { display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.wcp-modal-content { background: white; margin: 15% auto; padding: 25px; border-radius: 8px; width: 80%; max-width: 500px; position: relative; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.wcp-modal-close { position: absolute; right: 15px; top: 10px; font-size: 28px; font-weight: bold; cursor: pointer; color: #aaa; transition: color 0.2s; }
.wcp-modal-close:hover { color: #333; }

/* ------------------------------------------
   9. Store Page List View
   ------------------------------------------ */
.wcp-store-header { text-align: center; margin-bottom: 40px; padding: 30px; background: #f8f9fa; border-radius: 12px; }
.wcp-store-header h1 { font-size: 32px; margin: 0 0 10px; color: #333; }
.wcp-store-header p { font-size: 16px; color: #666; margin: 0; }
.wcp-store-list { display: flex; flex-direction: column; gap: 20px; }
.wcp-list-item { display: flex; align-items: center; background: white; border: 1px solid #eaeaea; border-radius: 12px; padding: 20px; transition: 0.3s; gap: 20px; }
.wcp-list-item:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.08); transform: translateY(-2px); }
.wcp-list-logo { flex-shrink: 0; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 2px solid #f0f0f0; background: #fff; display: flex; align-items: center; justify-content: center; }
.wcp-list-logo img { width: 100%; height: 100%; object-fit: cover; }
.wcp-list-content { flex-grow: 1; }
.wcp-list-content h3 { margin: 0 0 8px; font-size: 20px; color: #333; }
.wcp-list-content p { margin: 0 0 5px; font-size: 14px; color: #666; line-height: 1.5; }
.wcp-list-terms { font-size: 12px !important; color: #999 !important; font-style: italic; margin-top: 8px !important; }
.wcp-list-action { flex-shrink: 0; min-width: 140px; }

/* ------------------------------------------
   10. Responsive Adjustments
   ------------------------------------------ */
@media (max-width: 768px) {
    .wcp-list-item { flex-direction: column; text-align: center; }
    .wcp-list-action { width: 100%; min-width: auto; }
    .wcp-store-header h1 { font-size: 24px; }
    .wcp-modal-content { margin: 25% auto; width: 90%; }
    
    /* Stack scratch layout on very small screens for better UX */
    .wcp-scratch-wrapper { flex-direction: column; align-items: center; }
    .wcp-scratch-container { width: 100%; max-width: 240px; }
    .wcp-copy-btn { max-width: 100%; }
}