/* orders.css - стили для страницы заказов */

/* Контейнер списка заказов */
.orders-list {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Загрузка и сообщения */
.loading-indicator {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #7f8c8d;
}

.empty-orders,
.error-message {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.error-message {
    color: #e74c3c;
    background: #fdf3f2;
}

.not-authorized {
    text-align: center;
    padding: 40px;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 12px;
    color: #856404;
}

.not-authorized button {
    margin-top: 20px;
}

/* Карточка заказа */
.order-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    padding: 20px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.order-card:hover {
    border-color: #3498db;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.15);
}

.order-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.order-number {
    font-weight: 700;
    font-size: 1.2rem;
    color: #2c3e50;
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 20px;
}

.order-date {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.order-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: auto;
}

.status-new {
    background: #d1ecf1;
    color: #0c5460;
}

.status-processed {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.order-body {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.order-customer {
    flex: 2;
    min-width: 250px;
}

.order-customer p {
    margin: 5px 0;
    color: #2c3e50;
}

.order-summary {
    flex: 1;
    min-width: 200px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.order-summary p {
    margin: 5px 0;
}

.order-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

/* Кнопки действий */
.order-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #2c3e50;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.order-btn:hover {
    background: #3498db;
    border-color: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.order-btn:active {
    transform: translateY(0);
}

/* Кнопки в модальных окнах */
.modal-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #2c3e50;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 100px;
}

.modal-btn:hover {
    background: #e9ecef;
    border-color: #bdc3c7;
}

.modal-btn-primary {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.modal-btn-primary:hover {
    background: #2980b9;
    border-color: #2980b9;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.modal-btn-danger {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.modal-btn-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Модальные окна - исправленное позиционирование */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s ease;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    color: #e74c3c;
    background: #f8f9fa;
}

/* Детали заказа в модалке */
.order-details {
    margin: 20px 0;
    line-height: 1.8;
}

.order-details ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.order-details li {
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
}

.order-details li:last-child {
    border-bottom: none;
}

/* Форма редактирования */
#editForm .form-group {
    margin-bottom: 15px;
}

#editForm label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

#editForm input[type="text"],
#editForm input[type="tel"],
#editForm input[type="email"],
#editForm textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Oswald', sans-serif;
    transition: border-color 0.3s ease;
}

#editForm input:focus,
#editForm textarea:focus {
    outline: none;
    border-color: #3498db;
}

.cart-items-edit {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.edit-cart-list {
    list-style: none;
    padding: 0;
}

.edit-cart-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-cart-list .extra-item {
    color: #2c3e50;
}

.edit-cart-list input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Адаптивность */
@media (max-width: 768px) {
    .order-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .order-status {
        margin-left: 0;
    }
    
    .order-body {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}