/**
 * Govee Price Tracker - Frontend Styles
 */

/* ============================================
   General Styles
   ============================================ */

.pt-table-wrapper {
    margin: 20px 0;
    overflow-x: auto;
}

.pt-products-table {
    width: 100%;
    border-collapse: collapse;
}

.pt-products-table th,
.pt-products-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.pt-products-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.pt-products-table tr:hover {
    background-color: #f5f5f5;
}

/* ============================================
   Price Indicators
   ============================================ */

.pt-best-price {
    font-weight: 700;
    color: #28a745;
    font-size: 1.1em;
}

.pt-best-indicator {
    display: inline-block;
    background: #28a745;
    color: white;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
    font-weight: 600;
    text-transform: uppercase;
}

.pt-na {
    color: #999;
    font-style: italic;
}

.pt-savings {
    color: #dc3545;
    font-weight: 600;
}

/* ============================================
   Badges
   ============================================ */

.pt-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 8px;
}

.pt-badge-hot {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
   Row Highlighting
   ============================================ */

.pt-at-low {
    background-color: #fff3cd !important;
    border-left: 3px solid #ffc107;
}

.pt-at-low:hover {
    background-color: #ffe69c !important;
}

/* ============================================
   Links and Buttons
   ============================================ */

.pt-deal-link {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pt-deal-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white !important;
}

.pt-button {
    display: inline-block;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.pt-button:hover {
    background: #0056b3;
    color: white;
}

/* ============================================
   Price Charts
   ============================================ */

.pt-price-chart-wrapper {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pt-chart-title {
    margin: 0 0 20px 0;
    font-size: 1.5em;
    color: #333;
}

.pt-chart-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.pt-info-item {
    flex: 1;
    min-width: 150px;
}

.pt-info-item strong {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 0.9em;
}

.pt-comparison-chart-wrapper {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ============================================
   Best Deals Section
   ============================================ */

.pt-best-deals {
    margin: 30px 0;
}

.pt-best-deals h3 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #333;
}

.pt-deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.pt-deal-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.pt-deal-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-4px);
}

.pt-deal-card h4 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: #333;
}

.pt-deal-price {
    margin: 15px 0;
}

.pt-deal-price .current-price {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 5px;
}

.pt-deal-price .historical-low {
    display: block;
    font-size: 0.9em;
    color: #666;
}

.pt-deal-button {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pt-deal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

/* ============================================
   Simple List View
   ============================================ */

.pt-simple-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.pt-product-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}

.pt-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pt-product-card h4 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #333;
}

.pt-prices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.pt-price-amazon,
.pt-price-govee {
    font-size: 1.1em;
    font-weight: 600;
}

.pt-price-amazon {
    color: #ff9900;
}

.pt-price-govee {
    color: #4ECDC4;
}

/* ============================================
   Error and No Data Messages
   ============================================ */

.pt-error,
.pt-no-products,
.pt-no-data,
.pt-no-deals {
    padding: 20px;
    margin: 20px 0;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    color: #721c24;
}

.pt-no-products,
.pt-no-data,
.pt-no-deals {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .pt-products-table {
        font-size: 0.9em;
    }

    .pt-products-table th,
    .pt-products-table td {
        padding: 8px;
    }

    .pt-chart-info {
        flex-direction: column;
        gap: 10px;
    }

    .pt-deals-grid {
        grid-template-columns: 1fr;
    }

    .pt-simple-list {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   DataTables Customization
   ============================================ */

.pt-products-table.dataTable {
    border-collapse: collapse !important;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
}

/* ============================================
   Section Headers
   ============================================ */

.pt-section-title {
    font-size: 1.8em;
    margin: 0 0 10px 0;
    color: #333;
}

.pt-section-subtitle {
    color: #666;
    margin: 0 0 20px 0;
    font-size: 0.95em;
}

/* ============================================
   Discount Badge
   ============================================ */

.pt-discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b 0%, #dc3545 100%);
    color: white;
    font-size: 0.7em;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ============================================
   Deal Card Enhancements
   ============================================ */

.pt-deal-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 15px;
}

.pt-deal-price .original-price {
    display: block;
    color: #999;
    font-size: 0.9em;
    margin-top: 5px;
}

.pt-deal-price .savings {
    display: block;
    color: #dc3545;
    font-weight: 600;
    font-size: 0.9em;
    margin-top: 5px;
}

.pt-deal-source {
    color: #666;
    font-size: 0.85em;
    margin: 10px 0;
}

/* ============================================
   Great Deal Highlighting (30%+ off)
   ============================================ */

.pt-great-deal {
    background-color: #d4edda !important;
    border-left: 3px solid #28a745;
}

.pt-great-deal:hover {
    background-color: #c3e6cb !important;
}

/* ============================================
   Deals Section
   ============================================ */

.pt-deals-section {
    margin: 30px 0;
}

.pt-deals-table {
    width: 100%;
}

/* ============================================
   Newest Products Section
   ============================================ */

.pt-newest-products {
    margin: 30px 0;
}

/* ============================================
   Category Products Section
   ============================================ */

.pt-category-products {
    margin: 30px 0;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .pt-deal-link,
    .pt-button,
    .pt-deal-button {
        display: none;
    }

    .pt-products-table {
        font-size: 10pt;
    }

    .pt-badge {
        border: 1px solid #333;
        background: none !important;
        color: #333 !important;
    }
}
