/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-left h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.whatsapp-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.whatsapp-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
}

.whatsapp-cta i {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

.whatsapp-cta span {
    font-weight: 700;
}

.whatsapp-cta small {
    display: block;
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 400;
    margin-top: 2px;
}

.circular-refresh-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    font-size: 1.1rem;
}

.circular-refresh-btn:hover {
    transform: translateY(-2px) rotate(180deg);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.circular-refresh-btn:active {
    transform: translateY(0) rotate(180deg);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* Refresh indicator removed */

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

.subtitle {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 500;
}


/* Header controls removed */

.filter-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.filter-group select {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
    background: #edf2f7;
    border-color: #cbd5e0;
}

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

/* Loading and Error */
.loading, .error {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 600;
}

.loading i {
    font-size: 1.5rem;
    margin-right: 10px;
}

.error {
    color: #e53e3e;
    font-size: 1.1rem;
    font-weight: 600;
}

.error i {
    font-size: 1.5rem;
    margin-right: 10px;
}


/* Table cell styles */
.deal-date {
    font-size: 0.8rem;
    color: #718096;
    white-space: nowrap;
}

.deal-category {
    background: #edf2f7;
    color: #4a5568;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.deal-product {
    font-weight: 600;
    color: #2d3748;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deal-brand {
    color: #4a5568;
    font-weight: 500;
}

.deal-price {
    font-weight: 700;
    color: #2d3748;
    font-size: 1rem;
}

.deal-price.current {
    color: #38a169;
}

.deal-price.average {
    color: #718096;
    text-decoration: line-through;
}

.deal-discount {
    background: #f0fff4;
    color: #38a169;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
}

.deal-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.deal-rating .stars {
    color: #fbbf24;
}

.deal-rating .count {
    color: #718096;
    font-size: 0.8rem;
}

.deal-url {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.deal-url:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Load More */
.load-more-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
}

.load-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.load-more-status {
    color: #4a5568;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    color: white;
}

.footer p {
    margin-bottom: 10px;
    opacity: 0.9;
}

.footer p:last-child {
    margin-bottom: 0;
    font-size: 0.9rem;
    opacity: 0.7;
}

.footer-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    font-size: 0.9rem;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 700;
}

.close-modal {
    color: #718096;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #e53e3e;
}

.modal-body {
    padding: 30px;
}

.modal-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f7fafc;
}

.modal-detail-row:last-child {
    border-bottom: none;
}

.modal-detail-label {
    font-weight: 600;
    color: #4a5568;
    min-width: 120px;
}

.modal-detail-value {
    color: #2d3748;
    flex: 1;
    text-align: right;
}

.modal-detail-value.stars {
    text-align: left;
}

.modal-detail-value .stars {
    color: #fbbf24;
}

.modal-detail-value .count {
    color: #718096;
    font-size: 0.9rem;
    margin-left: 5px;
}


/* Grid Layout */
.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.deal-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.deal-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.deal-card-header {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.deal-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
    background: white;
    padding: 10px;
}

.deal-card:hover .deal-card-image {
    transform: scale(1.1);
}

.deal-card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff6b6b;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.deal-card-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(5px);
}

.deal-card-body {
    padding: 20px;
}

.deal-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.deal-card-brand {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
    margin-bottom: 12px;
}

.deal-card-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.deal-card-current-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #38a169;
}

.deal-card-original-price {
    font-size: 1rem;
    color: #718096;
    text-decoration: line-through;
}

.deal-card-discount {
    background: #f0fff4;
    color: #38a169;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
}

.deal-card-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.deal-card-stars {
    color: #fbbf24;
    font-size: 0.9rem;
}

.deal-card-rating-count {
    color: #718096;
    font-size: 0.8rem;
}

.deal-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.deal-card-footer-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.deal-card-date {
    font-size: 0.8rem;
    color: #718096;
}

.deal-card-site {
    font-size: 0.75rem;
    color: #4a5568;
    font-weight: 600;
    background: #f7fafc;
    padding: 2px 8px;
    border-radius: 12px;
    align-self: flex-start;
}

.deal-card-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.deal-card-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.deal-card-placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    color: #cbd5e0;
    font-size: 3rem;
}

/* Trending indicator */
.deal-card-trending {
    position: absolute;
    top: -5px;
    left: 15px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 0 0 15px 15px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    z-index: 10;
}

.deal-card-trending::before {
    content: "🔥";
    margin-right: 5px;
}


/* Improved description readability */
.deal-description {
    max-width: 300px;
    line-height: 1.5;
    color: #2d3748;
    font-weight: 500;
}

/* Responsive design */
@media (max-width: 1200px) {
    .deals-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .deals-table {
        font-size: 0.8rem;
    }

    .deals-table th,
    .deals-table td {
        padding: 12px 10px;
    }

    .deal-description {
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .header-left {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-left h1 {
        font-size: 2rem;
    }
    
    .header-logo {
        height: 50px;
    }
    
    .whatsapp-cta {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .whatsapp-cta small {
        display: none;
    }
    
    .circular-refresh-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* Refresh indicator removed */
    
    .deals-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .deal-card-header {
        height: 150px;
    }

    .deal-card-body {
        padding: 15px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .deals-table {
        min-width: 800px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .header-left h1 {
        font-size: 1.8rem;
    }
    
    .header-logo {
        height: 45px;
    }
    
    .whatsapp-cta {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .whatsapp-cta span {
        display: none;
    }
    
    .whatsapp-cta i {
        font-size: 1.3rem;
    }
    
    .circular-refresh-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    /* Refresh indicator removed */
    
    .deals-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .deal-card-header {
        height: 120px;
    }

    .deal-card-body {
        padding: 12px;
    }

    .deal-card-title {
        font-size: 1rem;
    }

    .deal-card-current-price {
        font-size: 1.2rem;
    }

    .header {
        padding: 20px;
    }
    
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .filters {
        padding: 20px;
    }
    
    .deals-table th,
    .deals-table td {
        padding: 10px 8px;
    }
}
