* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ee4d2d;
    --secondary-color: #ff6b35;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header */
.header {
    background: #3b5998;
    color: white;
    padding: 40px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    text-align: center;
}

.logo {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.logo-icon {
    font-size: 2.8rem;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

.logo-text {
    background: linear-gradient(135deg, #ffffff 0%, #fff9e6 50%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    position: relative;
}

.logo-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    border-radius: 4px;
    z-index: -1;
}

.logo-author {
    font-size: 1.8rem;
    font-weight: 600;
    opacity: 0.85;
    font-style: italic;
    letter-spacing: 0.5px;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
    }
}

.subtitle {
    font-size: 1.15rem;
    opacity: 0.92;
    font-weight: 400;
    letter-spacing: 0.3px;
}

@media (max-width: 768px) {
    .header {
        padding: 30px 0;
    }
    
    .logo {
        font-size: 2rem;
        gap: 8px;
    }
    
    .logo-icon {
        font-size: 2rem;
    }
    
    .logo-text {
        font-size: 1.8rem;
    }
    
    .logo-author {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 1rem;
    }
}

/* Main Content */
.main {
    flex: 1;
    padding: 30px 0;
}

/* Group Links Section */
.group-links-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-bottom: 25px;
    text-align: center;
}

.group-links-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.group-links-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.group-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    justify-content: center;
}

.group-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #ffffff;
}

.group-link-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.zalo-icon {
    background: #0068ff;
    color: white;
}

.telegram-icon {
    background: #0088cc;
    color: white;
}

.group-link-icon svg {
    width: 20px;
    height: 20px;
}

.group-link-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.zalo-link:hover .zalo-icon {
    background: #0052cc;
    transform: scale(1.1);
}

.telegram-link:hover .telegram-icon {
    background: #0066aa;
    transform: scale(1.1);
}

/* Time Selection Section */
.time-selection-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.time-select-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.time-select-wrapper label {
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

.time-select {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.time-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Price Filter Section */
.price-filter-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.price-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.price-filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.price-filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.price-filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Search Section */
.search-section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.search-btn:hover {
    background: #d63015;
    transform: translateY(-2px);
}

.search-btn:active {
    transform: translateY(0);
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.results-info {
    padding: 10px 0;
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 600;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 15px;
}

.filter-section label {
    font-weight: 600;
    color: var(--text-color);
}

.time-select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 200px;
}

.time-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.refresh-btn {
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.refresh-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

/* Loading */
.loading {
    text-align: center;
    padding: 50px 20px;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.product-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discount-badge-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary-color);
    color: white;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}


.affiliate-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 2.8em;
}

.product-price-section {
    margin-top: auto;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.current-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.original-price {
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.discount-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-light);
}

.amount-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    display: inline-block;
}

@media (max-width: 768px) {
    .amount-badge {
        background: transparent;
        color: var(--text-color);
        padding: 0;
        font-size: 0.95rem;
        border-radius: 0;
        font-weight: 600;
    }

    .product-meta {
        border-top: none;
        padding-top: 0;
        margin-top: 12px;
    }
}

.rating-badge {
    background: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
}

.sold-info {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 10px 18px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    padding: 10px 20px;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state p {
    font-size: 1.2rem;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}

/* Responsive Design */
@media (min-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1024px) and (max-width: 1399px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .search-box {
        flex-direction: column;
    }

    .search-btn {
        width: 100%;
    }

    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .time-select {
        width: 100%;
    }

    .refresh-btn {
        width: 100%;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 0 10px;
    }

    .time-select-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .time-select {
        width: 100%;
    }

    .price-filters {
        gap: 8px;
    }

    .price-filter-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .product-card {
        border-radius: 8px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
        margin-bottom: 0;
    }

    .product-card:hover {
        transform: none;
    }
    
    .product-card:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .product-image-wrapper {
        height: 140px;
        border-radius: 8px 8px 0 0;
    }

    .product-info {
        padding: 10px;
    }

    .product-title {
        font-size: 0.8rem;
        line-height: 1.3;
        margin-bottom: 8px;
        min-height: auto;
        -webkit-line-clamp: 2;
        color: #333;
        font-weight: 600;
    }

    .current-price {
        font-size: 1rem;
        font-weight: 700;
        color: #ee4d2d;
    }

    .original-price {
        font-size: 0.75rem;
        color: #999;
    }

    .product-meta {
        margin-top: 6px;
        padding-top: 0;
        font-size: 0.75rem;
        border-top: none;
    }

    .discount-badge-overlay {
        font-size: 0.75rem;
        padding: 3px 7px;
        border-radius: 12px;
        top: 6px;
        right: 6px;
        font-weight: 700;
    }


    .pagination {
        gap: 5px;
        padding: 0 10px;
    }

    .pagination button {
        padding: 10px 16px;
        font-size: 0.95rem;
    }

    .time-selection-section,
    .price-filter-section,
    .search-section {
        margin-bottom: 15px;
        padding: 15px;
    }

    .group-links-section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .group-links-title {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }

    .group-link {
        min-width: 160px;
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .group-link-icon {
        width: 28px;
        height: 28px;
    }

    .group-link-icon svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .header {
        padding: 25px 0;
    }

    .logo {
        font-size: 1.6rem;
    }

    .main {
        padding: 20px 0;
    }

    .search-section {
        padding: 15px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0;
    }

    .product-card {
        border-radius: 12px;
    }

    .product-image-wrapper {
        height: 120px;
        border-radius: 8px 8px 0 0;
    }

    .product-info {
        padding: 8px;
    }

    .product-title {
        font-size: 0.75rem;
        margin-bottom: 6px;
        -webkit-line-clamp: 2;
        line-height: 1.2;
    }

    .current-price {
        font-size: 0.95rem;
    }

    .original-price {
        font-size: 0.7rem;
    }

    .discount-badge-overlay {
        font-size: 0.7rem;
        padding: 2px 6px;
        border-radius: 10px;
        top: 4px;
        right: 4px;
        font-weight: 700;
    }


    .product-meta {
        font-size: 0.7rem;
        margin-top: 6px;
    }

    .time-selection-section,
    .price-filter-section {
        padding: 12px;
        margin-bottom: 12px;
    }

    .group-links-section {
        padding: 18px 12px;
        margin-bottom: 18px;
    }

    .group-links-title {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }

    .group-link {
        min-width: 140px;
        padding: 10px 16px;
        font-size: 0.9rem;
        gap: 10px;
    }

    .group-link-icon {
        width: 24px;
        height: 24px;
    }

    .group-link-icon svg {
        width: 16px;
        height: 16px;
    }

    .price-filters {
        gap: 6px;
    }

    .price-filter-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Maintenance Message */
.maintenance-message {
    background: var(--card-bg);
    padding: 60px 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 30px;
}

.maintenance-content {
    max-width: 500px;
    margin: 0 auto;
}

.maintenance-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.maintenance-message h2 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.maintenance-message p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.6;
}

.maintenance-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 20px;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Hidden class */
.hidden {
    display: none !important;
}

