/* Warehouse Component Styles - Apple-inspired */

#warehouse-container {
    padding: 20px 16px 100px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.warehouse-header {
    margin-bottom: 24px;
    text-align: center;
}

.warehouse-title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.warehouse-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

/* Filters */
.warehouse-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.warehouse-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.warehouse-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.warehouse-search {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    pointer-events: none;
}

.warehouse-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.warehouse-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.warehouse-search-input::placeholder {
    color: #9ca3af;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Import Button */
.import-button-container {
    margin-bottom: 16px;
}

.btn.import-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%) !important;
    border: 1px solid #c7d2fe !important;
    color: #5b21b6 !important;
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.1);
}

.btn.import-btn:hover {
    background: linear-gradient(135deg, #c7d2fe 0%, #ddd6fe 100%) !important;
    border-color: #a78bfa !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.import-btn span {
    font-size: 18px;
}

/* Import Modal */
.import-instruction {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.import-instruction p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

.import-upload-area {
    margin-bottom: 20px;
    position: relative;
}

.upload-placeholder {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.upload-placeholder:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.upload-placeholder.dragover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 13px;
    color: #9ca3af;
}

.upload-file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.file-name {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: #fecaca;
}

.import-result {
    margin-top: 20px;
    padding: 16px;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

.import-success {
    color: #059669;
    background: #d1fae5;
    padding: 12px;
    border-radius: 8px;
}

.import-success details {
    margin-top: 8px;
    cursor: pointer;
}

.import-success summary {
    font-weight: 600;
    user-select: none;
}

.import-error {
    color: #dc2626;
    background: #fee2e2;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Product Card */
.product-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.4s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

/* Product Photo in Corner */
.product-photo-corner {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 88px;
    height: 88px;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-photo-corner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    margin-bottom: 16px;
    padding-right: 100px;
}

.product-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.4;
    min-height: 42px;
    padding-right: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-article,
.product-store {
    font-size: 12px;
    color: #6b7280;
}

.product-article {
    font-weight: 500;
}

.product-cost-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.product-cost {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cost-amount {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cost-date {
    font-size: 11px;
    color: #9ca3af;
}

.product-no-cost {
    color: #9ca3af;
    font-size: 14px;
    font-style: italic;
}

.product-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
}

.action-btn:hover {
    border-color: #667eea;
    background: #f5f7ff;
    transform: scale(1.05);
}

.action-btn:active {
    transform: scale(0.95);
}

/* Empty State */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    z-index: 1002;
    background: white;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.warehouse-modal {
    max-width: 500px;
    border-radius: 20px;
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    text-align: center;
    flex: 1;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.modal-body {
    padding: 24px;
}

/* Edit Form */
.edit-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.product-info-text {
    flex: 1;
    min-width: 0;
}

.product-info-header .product-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    text-align: left;
}

.product-info-header .product-article {
    font-size: 13px;
    color: #6b7280;
    text-align: left;
}

.product-info-photo {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.form-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.form-input,
.form-select,
.form-textarea {
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.cost-input-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.cost-input {
    min-width: 0;
}

.currency-select {
    width: 120px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

.btn {
    flex: 1;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active,
.btn-secondary:active {
    transform: translateY(0);
}

/* History Timeline */
.history-product-header {
    text-align: center;
    margin-bottom: 20px;
}

.history-product-header .product-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.history-product-header .product-article {
    font-size: 13px;
    color: #6b7280;
}

.history-timeline {
    position: relative;
    padding-left: 32px;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.history-item {
    position: relative;
    margin-bottom: 24px;
    padding-bottom: 24px;
}

.history-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.history-indicator {
    position: absolute;
    left: -31px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
}

.history-item.current .history-indicator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.history-content {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-date {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.current-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.history-cost {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.cost-old {
    font-size: 14px;
    color: #9ca3af;
    text-decoration: line-through;
}

.arrow {
    color: #667eea;
    font-weight: bold;
}

.cost-new {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.history-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.history-user,
.history-period {
    font-size: 12px;
    color: #6b7280;
}

.history-user {
    font-weight: 600;
}

.history-comment {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    font-size: 13px;
    color: #4b5563;
    font-style: italic;
}

.empty-history,
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner */
.spinner {
    margin: 40px auto;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 640px) {
    #warehouse-container {
        padding: 16px 12px 100px;
    }

    .warehouse-title {
        font-size: 24px;
    }

    .warehouse-filters {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    .warehouse-modal {
        max-width: 90vw;
        margin: 20px;
    }

    .cost-input-group {
        grid-template-columns: 1fr;
    }

    .currency-select {
        width: 100%;
    }
}