/* Client View Comprehensive Styles */
:root {
    --primary: #005a87;
    --secondary: #8de969;
    --dark: #222;
    --light: #fff;
    --gray: #f4f5f7;
    --border-color: #dfe1e6;
    --text-secondary: #6b778c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 18px;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--gray);
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== TOP NOTICE ========== */
.top-notice {
    background-color: var(--secondary);
    color: var(--dark);
    text-align: center;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* ========== HEADER ========== */
.client-header {
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0, 90, 135, 0.25);
}

.header-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 1400px;
    margin: 0 auto;
}

.header-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.header-row-search {
    width: 100%;
}

.logo {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.logo span {
    color: var(--secondary);
}

.logo.back-link {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: none;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.2s;
}

.logo.back-link:hover {
    color: #fff;
}

/* Header Back Button */
.header-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
    flex-shrink: 0;
}

.header-back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Header Search */
.header-search {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.header-search .search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
}

.header-search input {
    width: 100%;
    padding: 11px 40px 11px 40px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.2s;
}

.header-search input::placeholder {
    color: #999;
}

.header-search input:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(141, 233, 105, 0.3);
}

.header-search .clear-search {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.header-search .clear-search:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--dark);
}

/* Filter Toggle Button */
.filter-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.filter-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.filter-toggle:active {
    transform: scale(0.97);
}

.filter-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff5630;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}

/* ========== QUICK FILTERS ========== */
.quick-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 4px;
    margin-bottom: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.quick-filters::-webkit-scrollbar {
    display: none;
}

.quick-chip {
    flex-shrink: 0;
    padding: 8px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 50px;
    background: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--dark);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.quick-chip:hover {
    border-color: var(--primary);
    background: rgba(0, 90, 135, 0.04);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.quick-chip:active {
    transform: scale(0.97) translateY(0);
}

.quick-chip:first-child {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--dark);
}

.quick-chip:first-child:hover {
    filter: brightness(0.95);
    border-color: var(--secondary);
    background: var(--secondary);
}

.quick-chip-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.quick-chip-more {
    border-color: var(--primary);
    color: var(--primary);
}

.quick-chip-more:hover {
    background: var(--primary);
    color: #fff;
}

/* ========== FILTER SIDEBAR ========== */
.filter-sidebar {
    position: fixed;
    top: 0;
    right: -340px;
    width: 340px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
    z-index: 1001;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: 24px;
}

.filter-sidebar.open {
    right: 0;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.filter-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--dark);
}

.close-filters {
    background: var(--gray);
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 8px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.close-filters:hover {
    background: #eee;
    color: var(--dark);
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    letter-spacing: 0.5px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    padding: 7px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 50px;
    background: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s;
    color: var(--dark);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-chip:hover {
    border-color: var(--primary);
    background: rgba(0, 90, 135, 0.04);
}

.filter-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.filter-chip.category {
    border-width: 1.5px;
}

.filter-chip.category.active {
    box-shadow: 0 2px 8px rgba(0, 90, 135, 0.25);
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary);
    color: #fff;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

.active-filter-chip button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    font-size: 0.85rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.active-filter-chip button:hover {
    opacity: 1;
}

/* Distance Badge */
.distance-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(0, 90, 135, 0.08);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.distance-badge i {
    font-size: 0.65rem;
}


.clear-all-filters {
    background: none;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
    width: 100%;
    margin-top: 16px;
}

.clear-all-filters:hover {
    border-color: #ff5630;
    color: #ff5630;
    background: rgba(255, 86, 48, 0.05);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* ========== GRID CONTAINER ========== */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* ========== LIST CONTAINER ========== */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========== COUPON CARD ========== */
.coupon-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.coupon-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.coupon-card:active {
    transform: translateY(-2px);
}

/* Card Image */
.card-img-top {
    width: 100%;
    height: 190px;
    object-fit: cover;
    background-color: #eee;
    transition: transform 0.3s ease;
}

.coupon-card:hover .card-img-top {
    transform: scale(1.03);
}

/* Image overflow hidden container */
.coupon-card {
    /* Prevents image scale overflow */
    overflow: hidden;
}

.card-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 4px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.3px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.card-subtitle {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 12px;
    font-weight: 500;
}

.card-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: auto;
    font-size: 0.8rem;
    color: #888;
}

/* Badges */
.badge-discount {
    background-color: var(--secondary);
    color: var(--dark);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    position: absolute;
    top: 12px;
    right: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 2;
}

.badge-status {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    z-index: 2;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.badge-status.open {
    background-color: rgba(54, 179, 126, 0.9);
    color: #fff;
    box-shadow: 0 2px 8px rgba(54, 179, 126, 0.3);
}

.badge-status.closed {
    background-color: rgba(255, 86, 48, 0.9);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 86, 48, 0.3);
}

/* ========== COUPON CARD - LIST VIEW ========== */
.view-list .coupon-card {
    flex-direction: row;
    min-height: 150px;
}

.view-list .card-img-top {
    width: 200px;
    height: 150px;
    flex-shrink: 0;
}

.view-list .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.view-list .card-footer-info {
    border-top: none;
    padding-top: 0;
    margin-top: 8px;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ddd;
}

.empty-state h3 {
    margin: 0 0 12px 0;
    color: var(--dark);
    font-size: 1.1rem;
}

.empty-state .btn-primary {
    margin-top: 16px;
}

/* ========== LOADING STATE ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== CARD ENTRANCE ANIMATION ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coupon-card {
    animation: fadeInUp 0.4s ease both;
}

.coupon-card:nth-child(1) {
    animation-delay: 0s;
}

.coupon-card:nth-child(2) {
    animation-delay: 0.05s;
}

.coupon-card:nth-child(3) {
    animation-delay: 0.1s;
}

.coupon-card:nth-child(4) {
    animation-delay: 0.15s;
}

.coupon-card:nth-child(5) {
    animation-delay: 0.2s;
}

.coupon-card:nth-child(6) {
    animation-delay: 0.25s;
}

/* ========== FOOTER ========== */
.client-footer {
    background: var(--dark);
    color: #fff;
    padding: 32px 16px;
    margin-top: 48px;
    text-align: center;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-copy {
    opacity: 0.6;
    font-size: 0.82rem;
    margin: 0;
}

.footer-credit {
    opacity: 0.5;
    font-size: 0.78rem;
    margin: 6px 0 0;
}

.footer-credit a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

.footer-credit a:hover {
    opacity: 0.85;
}

/* ========== RESPONSIVE — TABLET ========== */
@media (min-width: 481px) and (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .card-img-top {
        height: 160px;
    }
}

/* ========== RESPONSIVE — MOBILE ========== */
@media (max-width: 768px) {
    .header-container {
        gap: 8px;
    }

    .logo {
        font-size: 1rem;
    }

    .header-search input {
        padding: 10px 36px 10px 36px;
    }

    .filter-sidebar {
        width: 100%;
        right: -100%;
    }

    .main-content {
        padding: 16px 12px;
    }

    .view-list .coupon-card {
        flex-direction: row;
        min-height: 120px;
        align-items: stretch;
    }

    .view-list .card-img-top {
        width: 110px;
        height: auto;
        min-height: 100%;
        max-height: none;
    }

    .view-list .card-body {
        padding: 10px 12px;
    }

    .view-list .card-title {
        font-size: 0.9rem;
        margin-bottom: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .view-list .card-tag {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }

    .view-list .badge-status {
        top: 6px;
        left: 6px;
        font-size: 0.6rem;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    .client-header {
        padding: 10px 12px;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .card-img-top {
        height: 170px;
    }

    .card-title {
        font-size: 0.95rem;
    }

    .quick-chip {
        padding: 7px 14px;
        font-size: 0.78rem;
    }
}

/* ========== DESKTOP — SINGLE ROW HEADER ========== */
@media (min-width: 769px) {
    .header-container {
        flex-direction: row;
        align-items: center;
        gap: 20px;
    }

    .header-row-top {
        flex-shrink: 0;
    }

    .header-row-search {
        flex: 1;
        max-width: 600px;
    }

    .header-search {
        max-width: 600px;
    }

    .grid-container {
        gap: 22px;
    }
}

/* ========== VIEW SWITCHER ========== */
.view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 4px;
}

.result-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.view-switcher {
    display: flex;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.view-btn {
    border: none;
    background: none;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    color: var(--primary);
    background: rgba(0, 90, 135, 0.05);
}

.view-btn.active {
    color: var(--primary);
    background: rgba(0, 90, 135, 0.1);
}