/* Сучасні стилі для вкладки Прихід - arrivals.css */

#arrivals {
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 500px;
}

/* Контейнер форми */
#arrival-form {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

#arrival-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #f39c12);
}

/* Заголовок форми */
.arrival-form-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f3f4;
}

.arrival-form-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.arrival-form-subtitle {
    color: #7f8c8d;
    font-size: 1rem;
    font-weight: 400;
}

/* Основні поля форми */
.arrival-main-fields {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.arrival-field-group {
    position: relative;
}

.arrival-field-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.arrival-field-group input,
.arrival-field-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.arrival-field-group input:focus,
.arrival-field-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.arrival-field-group input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* Секція товарів */
.arrival-items-section {
    margin-bottom: 2rem;
}

.arrival-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.arrival-items-title {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Кнопка додавання товару */
.add-item-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 3px 8px rgba(46, 204, 113, 0.3);
}

.add-item-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.add-item-btn:active {
    transform: translateY(0);
}

/* Таблиця товарів */
.arrival-items-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

#arrival-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

#arrival-items-table th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #495057;
    font-weight: 600;
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

#arrival-items-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

#arrival-items-table tbody tr {
    transition: all 0.2s ease;
}

#arrival-items-table tbody tr:hover {
    background: rgba(52, 152, 219, 0.05);
    transform: scale(1.01);
}

/* Поля в таблиці */
#arrival-items-table select,
#arrival-items-table input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: white;
}

#arrival-items-table select:focus,
#arrival-items-table input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* Кнопка видалення */
.remove-arrival-item {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.remove-arrival-item:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* Кнопки форми */
.arrival-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f1f3f4;
}

.arrival-submit-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    min-width: 200px;
    justify-content: center;
}

.arrival-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.arrival-submit-btn:active {
    transform: translateY(-1px);
}

/* Повідомлення */
#arrival-success,
#arrival-error {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: messageSlideIn 0.4s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#arrival-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 1px solid #c3e6cb;
}

#arrival-success::before {
    content: '✅';
    font-size: 1.2rem;
}

#arrival-error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#arrival-error::before {
    content: '❌';
    font-size: 1.2rem;
}

/* Порожня таблиця */
.arrival-items-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #7f8c8d;
    font-style: italic;
    background: #f8f9fa;
}

.arrival-items-empty::before {
    content: '📦';
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Адаптивність для планшетів */
@media (max-width: 768px) {
    #arrivals {
        padding: 1rem;
    }
    
    #arrival-form {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .arrival-main-fields {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .arrival-items-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .arrival-form-title {
        font-size: 1.5rem;
    }
    
    #arrival-items-table {
        font-size: 0.9rem;
    }
    
    #arrival-items-table th,
    #arrival-items-table td {
        padding: 0.5rem 0.25rem;
    }
}

/* Адаптивність для мобільних */
@media (max-width: 480px) {
    #arrivals {
        padding: 0.5rem;
    }
    
    #arrival-form {
        padding: 1rem;
        border-radius: 10px;
    }
    
    .arrival-form-title {
        font-size: 1.3rem;
        flex-direction: column;
    }
    
    .arrival-main-fields {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    /* Мобільний вигляд таблиці */
    .arrival-items-container {
        overflow-x: auto;
    }
    
    #arrival-items-table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    
    #arrival-items-table th {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
    
    #arrival-items-table td {
        padding: 0.5rem 0.25rem;
    }
    
    #arrival-items-table select,
    #arrival-items-table input {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .remove-arrival-item {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .arrival-form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .arrival-submit-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-width: auto;
    }
    
    .add-item-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* Додаткові мікроанімації */
.arrival-field-group input:focus + label,
.arrival-field-group select:focus + label {
    color: #3498db;
    transform: translateY(-2px);
}

/* Індикатор завантаження */
.arrival-loading {
    position: relative;
    overflow: hidden;
}

.arrival-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.2), transparent);
    animation: loadingSlide 1.5s infinite;
}

@keyframes loadingSlide {
    0% { left: -100%; }
    100% { left: 100%; }
}