/* Frontend Dashboard Styles */
#pharma-deals-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-header h2 {
    color: #333;
    font-size: 28px;
    margin: 0;
    font-weight: 700;
}

.search-filter {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-filter input,
.search-filter select {
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-filter input:focus,
.search-filter select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.search-filter input {
    min-width: 250px;
}

.search-filter select {
    min-width: 180px;
}

/* Deals Grid */
.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.deal-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.deal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #2271b1;
}

.deal-card.expiring-soon {
    border-left: 4px solid #ff6b35;
    background: linear-gradient(135deg, #fff 0%, #fff5f2 100%);
}

.deal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.product-name {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    margin-right: 10px;
}

.discount-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.deal-body {
    margin-bottom: 20px;
}

.supplier-info {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.supplier-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 12px;
    text-transform: uppercase;
}

.supplier-name {
    font-weight: 700;
    color: #2271b1;
    font-size: 14px;
}

.price-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.price-row:last-child {
    margin-bottom: 0;
}

.price-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.offer-price {
    font-size: 18px;
    font-weight: 700;
    color: #28a745;
}

.normal-price {
    font-size: 16px;
    color: #6c757d;
    text-decoration: line-through;
}

.savings-row {
    border-top: 1px solid #dee2e6;
    padding-top: 8px;
    margin-top: 8px;
}

.savings-label {
    font-weight: 600;
    color: #495057;
}

.savings-amount {
    font-size: 16px;
    font-weight: 700;
    color: #dc3545;
}

.pack-size,
.offer-type,
.notes {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.pack-size strong,
.offer-type strong,
.notes strong {
    color: #495057;
    font-weight: 600;
}

.deal-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.expiry-info {
    font-size: 14px;
}

.expiry-label {
    color: #6c757d;
    font-weight: 500;
}

.expiry-date {
    font-weight: 600;
    color: #495057;
    margin-left: 5px;
}

.days-left {
    color: #28a745;
    font-weight: 600;
    margin-left: 5px;
}

.expiry-info.urgent .expiry-date,
.expiry-info.urgent .days-left {
    color: #dc3545;
}

.contact-supplier-btn {
    background: linear-gradient(135deg, #2271b1 0%, #72aee6 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-supplier-btn:hover {
    background: linear-gradient(135deg, #1a5a8a 0%, #5a9bd4 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 113, 177, 0.3);
}

/* Modal Styles */
.pharma-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 700;
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #000;
}

.modal-body {
    padding: 25px;
}

.modal-body p {
    margin-bottom: 20px;
    color: #495057;
    font-size: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.submit-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e7a 100%);
    transform: translateY(-1px);
}

.cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #5a6268;
}

/* Empty States and Messages */
.no-deals,
.error-message {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-deals h3,
.error-message h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #495057;
}

.retry-btn {
    background: #2271b1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.retry-btn:hover {
    background: #1a5a8a;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .search-filter {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-filter input,
    .search-filter select {
        width: 100%;
        min-width: unset;
    }
    
    .deals-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .deal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .contact-supplier-btn {
        width: 100%;
        padding: 12px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .submit-btn,
    .cancel-btn {
        width: 100%;
        padding: 14px;
    }
    
    /* Deal Cards Styling */
.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.deal-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.deal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.deal-card.active {
    border-left: 4px solid #28a745;
}

.deal-card.expired {
    border-left: 4px solid #dc3545;
    opacity: 0.8;
}

.deal-card h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.deal-card p {
    margin: 5px 0;
    color: #666;
}

.price-info {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.offer-price {
    font-size: 24px;
    font-weight: bold;
    color: #28a745;
}

.normal-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.savings {
    font-size: 16px;
    font-weight: bold;
    color: #007cba;
    background: #e8f4f8;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 5px;
}

.deal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
}

.discount {
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status.active {
    background: #d4edda;
    color: #155724;
}

.status.expired {
    background: #f8d7da;
    color: #721c24;
}

.expiry {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .deals-grid {
        grid-template-columns: 1fr;
    }
    
    .search-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-filter input,
    .search-filter select,
    .search-filter button {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* Loading and empty states */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

#no-deals {
    text-align: center;
    padding: 40px;
    color: #999;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

/* Counter animation */
.deal-counter {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.deal-card .product-expiry {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 3px;
    font-size: 13px;
    color: #856404;
}

.deal-card .product-expiry strong {
    font-weight: 600;
    color: #7c5a03;
}

/* Frontend Inflation Tracker Styles */
#pharma-inflation-tracker {
    max-width: 1200px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.inflation-tracker-header {
    margin-bottom: 30px;
}

.inflation-tracker-header h2 {
    color: #2C3E50;
    margin: 0 0 20px 0;
}

.month-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.month-selector label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: 600;
    color: #555;
}

.month-selector input[type="month"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.month-selector .button {
    padding: 10px 20px;
    background: #DC143C;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.month-selector .button:hover {
    background: #B01030;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

.inflation-card {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
    background: white;
}
