/* 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);
}

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

/* Top Notice */
.top-notice {
    background-color: var(--secondary);
    color: var(--dark);
    text-align: center;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Enhanced Header */
.client-header {
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-container {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    text-decoration: none;
    white-space: nowrap;
}

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

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

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

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

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

.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);
}

/* Header Actions (Sort & Filter) */
.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sort-select {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: var(--dark);
    padding: 8px 32px 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.sort-select:hover {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sort-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.2);
}

.filter-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    position: relative;
}

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

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

/* Filter Sidebar */
.filter-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

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

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

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

.close-filters {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

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

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

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

.filter-chip {
    padding: 8px 14px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-chip:hover {
    border-color: var(--primary);
    background: rgba(0, 124, 186, 0.05);
}

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

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

.filter-chip.category.active {
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

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

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

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

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

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

.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: 24px 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 - Grid View */
.coupon-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.coupon-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-img-top {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: #eee;
}

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

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

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

.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: 12px;
    margin-top: auto;
    font-size: 0.85rem;
    color: #777;
}

.badge-discount {
    background-color: var(--secondary);
    color: var(--dark);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    position: absolute;
    top: 12px;
    right: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.badge-status {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
}

.badge-status.open {
    background-color: #36b37e;
    /* Green */
}

.badge-status.closed {
    background-color: #ff5630;
    /* Red */
}

/* 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: #777;
}

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

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

.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);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        gap: 12px;
    }

    .logo {
        font-size: 1rem;
    }

    .header-search {
        max-width: none;
    }

    .view-modes {
        gap: 4px;
    }

    .view-btn,
    .filter-toggle {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

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

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

    .view-list .coupon-card {
        flex-direction: column;
    }

    .view-list .card-img-top {
        width: 100%;
        height: 180px;
    }

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

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

    .header-search input {
        font-size: 0.9rem;
        padding: 8px 36px 8px 36px;
    }
}