/* history.css - Стили для страницы истории заказов */

/* Базовые стили для страницы истории заказов */
.orders-history-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.orders-history-section h2 {
    font-size: 32px;
    margin-bottom: 25px;
    text-align: center;
    color: #333;
    border-bottom: 2px solid #ff6b00;
    padding-bottom: 10px;
    display: inline-block;
}

/* Стили для таблицы заказов */
.orders-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.orders-table th {
    background-color: #ff6b00;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 500;
    font-size: 18px;
}

.orders-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    font-size: 16px;
}

.orders-table tr:last-child td {
    border-bottom: none;
}

.orders-table tr:hover {
    background-color: #fff8f5;
}

/* Стили для кнопок действий */
.order-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    position: relative;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-btn::before {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    line-height: 1;
}

.action-btn.view::before {
    content: "👁";
    color: #2196f3;
}

.action-btn.edit::before {
    content: "✏️";
    color: #ff9800;
}

.action-btn.delete::before {
    content: "🗑";
    color: #f44336;
}

.action-btn:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

.action-btn:hover::before {
    transform: scale(1.1);
}

/* Стили для модальных окон */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #ff6b00;
}

.modal-header h3 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    line-height: 1;
}

.close-btn:hover {
    background-color: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 30px;
}

/* Стили для деталей заказа */
.order-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.order-detail-item {
    margin-bottom: 15px;
}

.order-detail-item label {
    display: block;
    font-weight: 500;
    color: #666;
    margin-bottom: 5px;
    font-size: 14px;
}

.order-detail-item p {
    margin: 0;
    font-size: 16px;
    color: #333;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 3px solid #ff6b00;
}

.order-dishes-list {
    margin-top: 10px;
}

.order-dish-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
    margin-bottom: 5px;
    border-radius: 6px;
}

.order-dish-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Стили для формы редактирования */
.edit-form .form-group {
    margin-bottom: 20px;
}

.edit-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
}

.edit-form input[type="text"],
.edit-form input[type="email"],
.edit-form input[type="tel"],
.edit-form textarea,
.edit-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Oswald', sans-serif;
    transition: border-color 0.3s;
    background-color: #f9f9f9;
}

.edit-form input:focus,
.edit-form textarea:focus,
.edit-form select:focus {
    outline: none;
    border-color: #ff6b00;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.edit-form .radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.edit-form .radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.edit-form .radio-option:hover {
    background-color: #f5f5f5;
}

.edit-form .time-input-container {
    margin-top: 10px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* Стили для подтверждения удаления */
.delete-confirmation {
    text-align: center;
    padding: 30px 20px;
}

.delete-confirmation p {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
    line-height: 1.5;
}

.delete-confirmation p:last-child {
    margin-bottom: 30px;
}

.delete-confirmation strong {
    color: #f44336;
}

/* Кнопки в модальных окнах */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid #eee;
}

.btn {
    padding: 12px 25px;
    border-radius: 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid;
    min-width: 120px;
    text-align: center;
}

.btn-primary {
    background-color: #ff6b00;
    border-color: #ff6b00;
    color: white;
}

.btn-primary:hover {
    background-color: #e55a00;
    border-color: #e55a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.btn-secondary {
    background-color: white;
    border-color: #ddd;
    color: #333;
}

.btn-secondary:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background-color: #f44336;
    border-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
    border-color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* Сообщения о состоянии */
.loading-message,
.error-message,
.empty-message {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    background-color: #f9f9f9;
    border-radius: 10px;
    margin: 20px 0;
    border: 2px solid;
}

.loading-message {
    color: #666;
    border-color: #ff6b00;
}

.error-message {
    color: #f44336;
    border-color: #f44336;
}

.empty-message {
    color: #666;
    border-color: #ddd;
    border-style: dashed;
}

.empty-message a {
    color: #ff6b00;
    text-decoration: none;
    font-weight: 500;
}

.empty-message a:hover {
    text-decoration: underline;
}

/* Адаптивность */
@media (max-width: 768px) {
    .orders-table {
        display: block;
        overflow-x: auto;
    }
    
    .order-details-grid {
        grid-template-columns: 1fr;
    }
    
    .modal {
        width: 95%;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .edit-form .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .orders-table th,
    .orders-table td {
        padding: 10px;
        font-size: 14px;
    }
    
    .action-btn {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h3 {
        font-size: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 15px;
    }
}

/* Стили для информации о заказе в таблице */
.order-dishes-tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dashed #666;
}

.order-dishes-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: normal;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Стили для скролла в модальных окнах */
.modal::-webkit-scrollbar {
    width: 8px;
}

.modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 15px 15px 0;
}

.modal::-webkit-scrollbar-thumb {
    background: #ff6b00;
    border-radius: 4px;
}

.modal::-webkit-scrollbar-thumb:hover {
    background: #e55a00;
}
