/* ==========================================
   WP COUPONS PRO - FRONTEND STYLES
   Version: 3.6.1 (Complete & Fixed)
   ========================================== */

/* ------------------------------------------
   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. Premium Coupon Code Display & Copy Button
   ------------------------------------------ */
.wcp-code-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.wcp-code-label {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wcp-code-box { 
    display: flex; 
    align-items: stretch; 
    width: 100%; 
    max-width: 300px; 
    background: #f8fbff; 
    border: 2px dashed #5b9bd5; 
    border-radius: 8px; 
    overflow: hidden; 
    margin: 0 auto; 
}

.wcp-code-value { 
    font-family: 'Courier New', Courier, monospace; 
    font-size: 20px; 
    font-weight: 900; 
    color: #2c3e50; 
    flex-grow: 1; 
    padding: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-transform: uppercase; 
}

.wcp-copy-btn-inline { 
    background: #5b9bd5; 
    color: white; 
    border: none; 
    border-left: 2px dashed #fff; 
    padding: 0 20px; 
    font-size: 14px; 
    font-weight: 700; 
    cursor: pointer; 
    text-transform: uppercase; 
    transition: background 0.2s;
}

.wcp-copy-btn-inline:hover { background: #4a8bc5; }
.wcp-copy-btn-inline.copied { background: #28a745; }

/* ------------------------------------------
   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. Regional Coupons Table Styles
   ------------------------------------------ */
.wcp-regional-coupon-section {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.wcp-regional-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 10px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #2c3e50;
    letter-spacing: -0.5px;
}

.wcp-regional-promo-dates {
    font-size: 15px;
    color: #666;
    font-style: italic;
    margin: 0 0 25px 0;
}

.wcp-regional-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.wcp-regional-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 15px;
}

.wcp-regional-table thead {
    background: #f8f9fa;
}

.wcp-regional-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wcp-regional-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.wcp-regional-table tbody tr:hover {
    background: #f8f9fa;
    transition: background 0.2s ease;
}

.wcp-regional-table tbody tr:last-child td {
    border-bottom: none;
}

.wcp-code-cell {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: #2c3e50;
    font-size: 16px;
    letter-spacing: 0.5px;
}

/* ------------------------------------------
   11. Copy All Codes Button (Regional Coupons)
   ------------------------------------------ */
.wcp-copy-all-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    letter-spacing: 0.5px;
    margin-top: 20px;
}

.wcp-copy-all-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

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

.wcp-copy-all-btn.copied {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.wcp-copy-all-icon {
    font-size: 18px;
}

/* ------------------------------------------
   12. 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%; }
    
    .wcp-list-item .wcp-code-box { max-width: 100%; }
    .wcp-list-item .wcp-copy-btn-inline { padding: 0 16px; }
    
    .wcp-regional-coupon-section { padding: 20px; margin: 20px auto; }
    .wcp-regional-title { font-size: 22px; }
    .wcp-regional-table th, .wcp-regional-table td { padding: 12px 15px; font-size: 14px; }
    .wcp-code-cell { font-size: 14px; }
}

@media (max-width: 480px) {
    .wcp-code-box { max-width: 100%; flex-direction: column; }
    .wcp-code-value { font-size: 18px; padding: 14px 16px; }
    .wcp-copy-btn-inline { padding: 12px 20px; border-left: none; border-top: 2px dashed #fff; }
}