/* Warehouse-specific styles */

/* Tabs Navigation */
.tabs-section {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e9ecef;
    overflow-x: auto;
}

.tab-btn {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    min-width: 150px;
    justify-content: center;
}

.tab-btn:hover {
    color: #495057;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
    font-weight: 600;
}

.tab-btn i {
    font-size: 16px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 i {
    color: #667eea;
}

/* Filter and Add Section */
.filter-and-add {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    color: #333;
    min-width: 150px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Modal Enhancements - ใช้สไตล์เดียวกันกับ stock_products.css */
.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 2rem;
}

/* Form Grid Enhancement - ปรับให้เหมือน stock_products.css */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    color: #495057;
    background: white;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
}

/* Form Actions - ปรับให้เหมือน stock_products.css */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
    margin-top: 1rem;
}

/* Status Badges for Warehouse */
.status-warehouse-active {
    background: #28a745;
    color: white;
}

.status-warehouse-inactive {
    background: #6c757d;
    color: white;
}

/* Zone Count Display */
.zone-count, .shelf-count {
    font-weight: 600;
    color: #667eea;
    background: #f8f9ff;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 13px;
    display: inline-block;
    min-width: 30px;
    text-align: center;
}

/* Enhanced Button Styling */
.btn-icon-only {
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Action Buttons Enhancement */
.action-buttons .btn-sm {
    min-width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-buttons .btn-sm i {
    font-size: 12px;
}

/* Table Enhancements */
.products-table td:nth-child(1),
.products-table td:nth-child(2),
.products-table td:nth-child(3),
.products-table td:nth-child(5) {
    font-weight: 500;
}

.products-table td:nth-child(1) {
    color: #495057;
    font-weight: 600;
}

.products-table td:nth-child(2) {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 600;
    color: #007bff;
}

/* Zone and Shelf specific styling */
.zone-info, .shelf-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zone-info i, .shelf-info i {
    color: #667eea;
    font-size: 14px;
}

/* Loading States */
.loading-row {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.loading-row i {
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Error State */
.error-state {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    background: #fff5f5;
    border-radius: 8px;
    margin: 1rem 0;
}

.error-state i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Form Validation States */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group .error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-group .error-message i {
    font-size: 10px;
}

/* Success States */
.form-group input.success,
.form-group select.success,
.form-group textarea.success {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Loading Button State */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading i {
    animation: spin 1s linear infinite;
}

/* Animation Enhancements */
.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltip */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design - ปรับปรุงให้เหมือน stock_products.css */
@media (max-width: 768px) {
    .tabs-nav {
        border-bottom: none;
        background: #f8f9fa;
        border-radius: 8px;
        padding: 4px;
        margin-bottom: 1rem;
    }
    
    .tab-btn {
        flex: 1;
        min-width: auto;
        padding: 0.75rem 0.5rem;
        font-size: 12px;
        border-radius: 6px;
        border-bottom: none;
    }
    
    .tab-btn.active {
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-and-add {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-select {
        flex: 1;
        min-width: auto;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .zone-count, .shelf-count {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .action-buttons .btn-sm {
        width: 100%;
        height: 32px;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
    }

    .modal-body {
        padding: 1rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tab-btn {
        padding: 0.5rem 0.25rem;
        font-size: 11px;
    }
    
    .tab-btn span {
        display: none;
    }
    
    .section-header h2 {
        font-size: 1.25rem;
    }
    
    .products-table {
        font-size: 12px;
    }
    
    .products-table th,
    .products-table td {
        padding: 8px 6px;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }
}

/* iPad and Tablet Optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        width: 85%;
    }
}