/* Product Management Module Styles */

/* Summary Cards with Help Icons */
.summary-card {
    position: relative;
}

.help-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #9ca3af;
    color: white;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
    z-index: 10;
}

.help-icon:hover {
    opacity: 1;
    background-color: #6b7280;
}

/* Tooltip Styles */
.tooltip {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    max-width: 280px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.tooltip-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #f9fafb;
}

.tooltip-content {
    color: #d1d5db;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

/* Modern Filter Interface */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.filter-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-outline {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.filter-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.quick-filters {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.quick-filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.quick-filter-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
    white-space: nowrap;
}

.quick-filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-filter-btn {
    background: white;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-filter-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.quick-filter-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

.advanced-filters .filter-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: end;
}

.advanced-filters .filter-row:last-child {
    grid-template-columns: 1fr 1fr 1fr;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.filter-input, .filter-select {
    height: 42px;
    padding: 0 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    transition: border-color 0.2s ease;
}

.filter-input:focus, .filter-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-input {
    min-width: 250px;
}

@media (max-width: 768px) {
    .filter-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .filter-actions {
        justify-content: space-between;
    }
    
    .quick-filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .advanced-filters .filter-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filter-input {
        min-width: auto;
    }
}

/* Product Overview Cards */
.product-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.product-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.product-card h3 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
}

.product-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #059669;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Stock Status Indicators */
.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.stock-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.stock-high .stock-indicator { background-color: #10b981; }
.stock-medium .stock-indicator { background-color: #f59e0b; }
.stock-low .stock-indicator { background-color: #ef4444; }
.stock-unlimited .stock-indicator { background-color: #6366f1; }

/* Product Filters */
.product-filters {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.filter-select,
.filter-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Purchase Table Enhancements */
.purchase-table {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

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

.purchase-table th {
    background: #f9fafb;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

.purchase-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}

.purchase-table tr:hover {
    background: #f9fafb;
}

/* Product Info in Table */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.product-name {
    font-weight: 500;
    color: #1f2937;
}

.product-code {
    font-size: 0.75rem;
    color: #6b7280;
    font-family: monospace;
}

.product-category {
    font-size: 0.75rem;
    color: #059669;
    background: #ecfdf5;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
}

/* Registration Info */
.registration-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.registration-number {
    font-weight: 500;
    color: #1f2937;
    font-family: monospace;
}

.registration-contact {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Quantity and Pricing */
.quantity-info {
    text-align: center;
    font-weight: 500;
}

.price-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.unit-price {
    font-size: 0.875rem;
    color: #6b7280;
}

.total-price {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
}

.pricing-tier {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    background: #dbeafe;
    color: #1e40af;
}

/* Stock Status Badges */
.stock-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.stock-status-reserved {
    background: #fef3c7;
    color: #92400e;
}

.stock-status-confirmed {
    background: #d1fae5;
    color: #065f46;
}

.stock-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.stock-status-refunded {
    background: #e0e7ff;
    color: #3730a3;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-action {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
}

.btn-view {
    background: #3b82f6;
    color: white;
}

.btn-view:hover {
    background: #2563eb;
}

.btn-edit {
    background: #059669;
    color: white;
}

.btn-edit:hover {
    background: #047857;
}

.btn-cancel {
    background: #dc2626;
    color: white;
}

.btn-cancel:hover {
    background: #b91c1c;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.summary-value {
    font-size: 2rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.summary-label {
    color: #6b7280;
    font-size: 0.875rem;
}

.summary-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.summary-change.positive {
    color: #059669;
}

.summary-change.negative {
    color: #dc2626;
}

/* Export and Bulk Actions */
.bulk-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.bulk-actions-left {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.bulk-actions-right {
    display: flex;
    gap: 0.5rem;
}

.btn-export {
    background: #059669;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-export:hover {
    background: #047857;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-overview {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .purchase-table {
        overflow-x: auto;
    }
    
    .purchase-table table {
        min-width: 800px;
    }
    
    .bulk-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bulk-actions-left,
    .bulk-actions-right {
        justify-content: center;
    }
}

/* Loading States */
.loading-overlay {
    position: relative;
}

.loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: #374151;
}

.empty-state p {
    margin: 0;
    font-size: 0.875rem;
}
