/* ==========================================================================
   ALL FREE COUPONS PAGE STYLES (100% UNIQUE afc- PREFIX)
   ========================================================================== */

.afc-page {
    background-color: var(--bg-body);
    min-height: calc(100vh - 400px);
}

/* 1. Filter Bar */
.afc-filter-bar {
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.afc-filter-bar:focus-within {
    box-shadow: 0 8px 24px rgba(10, 37, 64, 0.08);
}

.afc-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1.1rem;
    z-index: 5;
}

.afc-clear-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: #f1f5f9;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.afc-clear-btn:hover {
    background: #e2e8f0;
    color: var(--primary-color);
}

/* 2. Coupon Card */
.afc-coupon-card {
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.afc-coupon-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

.afc-coupon-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(10, 37, 64, 0.12);
    border-color: rgba(255, 107, 0, 0.3);
    z-index: 2;
}

.afc-coupon-card-inner {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    flex: 1;
    width: 100%;
}

/* Title */
.afc-coupon-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    line-height: 1.3;
    min-height: 50px;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.afc-coupon-card:hover .afc-coupon-title {
    color: var(--secondary-color);
}

/* Image */
.afc-coupon-image-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.afc-coupon-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.afc-coupon-card:hover .afc-coupon-image {
    transform: scale(1.08);
}

.afc-coupon-qty-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    z-index: 3;
}

/* Footer */
.afc-coupon-footer {
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.afc-merchant-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #ff8c42 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.afc-merchant-name {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Buttons */
.afc-coupon-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.afc-btn-claim {
    flex: 1.3;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #ff8c42 100%);
    color: #ffffff;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(255, 107, 0, 0.25);
    cursor: pointer;
}

.afc-btn-claim:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 0, 0.4);
    color: #ffffff;
}

.afc-btn-claim:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.afc-btn-detail {
    flex: 1;
    background: transparent;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.afc-btn-detail:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-2px);
}

/* 3. Pagination */
.afc-pagination .page-link {
    border: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
    margin: 0 4px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.afc-pagination .page-link:hover {
    background: rgba(255, 107, 0, 0.1);
    color: var(--secondary-color);
    border-color: rgba(255, 107, 0, 0.3);
}

.afc-pagination .page-item.active .page-link {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(10, 37, 64, 0.2);
}

.afc-pagination .page-item.disabled .page-link {
    opacity: 0.5;
    background: #f8f9fa;
}

/* 4. Skeleton Loading */
.afc-skeleton-card {
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.afc-skeleton-bg {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: afc-skeleton-loading 1.5s infinite;
}

@keyframes afc-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 5. Animations */
@keyframes afc-fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.afc-animate-in {
    animation: afc-fadeInUp 0.5s ease forwards;
    opacity: 0;
}

/* 6. Modals */
.afc-modal .modal-content {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.afc-modal-header {
    padding: 1.5rem;
    text-align: center;
    border: none;
}

.afc-modal-header.login-required {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a3a5c 100%);
    color: #ffffff;
}

.afc-modal-header.already-claimed {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #ffffff;
}

.afc-modal-header.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
}

.afc-modal-header.error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #ffffff;
}

.afc-modal-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
}

.afc-modal-body {
    padding: 2rem 1.5rem;
    text-align: center;
}

.afc-modal-body p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.afc-modal-footer {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    border: none;
}

.btn-afc-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #ff8c42 100%);
    color: #ffffff;
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-afc-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 0, 0.3);
    color: #ffffff;
}

.btn-afc-secondary {
    background: #f1f5f9;
    color: var(--text-main);
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-afc-secondary:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

/* 7. Mobile Responsiveness */
@media (max-width: 768px) {
    .afc-filter-bar .row {
        flex-direction: column;
    }
    .afc-filter-bar .d-flex {
        justify-content: stretch !important;
    }
    .afc-filter-bar .btn, 
    .afc-filter-bar .dropdown {
        flex: 1;
    }
}