/* Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
}

/* Основная структура */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Навигация */
header {
    background-color: #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
    height: 70px;
}

.menu li {
    position: relative;
}

.menu a {
    display: block;
    padding: 0 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    height: 70px;
    line-height: 70px;
}

.menu a:hover {
    color: #FF8C00;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    z-index: 1;
    overflow: hidden;
}

.dropdown-content li {
    width: 100%;
}

.dropdown-content a {
    height: auto;
    line-height: 1.5;
    padding: 12px 20px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #FF8C00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: #FF8C00;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background-color: #FF7700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.2);
}

.btn-small {
    padding: 8px 15px;
    font-size: 14px;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

/* Карточки и контейнеры */
.login-form,
.registration-form,
.announcements,
.dashboard-container,
.admin-container {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.login-form h2,
.registration-form h2,
.announcements h2 {
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

/* Уведомления */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Личный кабинет */
.dashboard-container {
    display: flex;
    gap: 30px;
}

.tickets-list {
    flex: 1;
    max-width: 35%;
}

.ticket-form {
    flex: 2;
}

.ticket-item {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.ticket-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Панель администратора */
.admin-filters {
    background-color: #fff8f0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tickets-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.tickets-table th,
.tickets-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.tickets-table th {
    background-color: #fff8f0;
    font-weight: 600;
}

.tickets-table tr:hover {
    background-color: #fff8f0;
}

.status-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.status-select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

/* Статусы */
.status-Отправлена {
    color: #FF8C00;
    font-weight: 500;
}

.status-В работе {
    color: #3498db;
    font-weight: 500;
}

.status-Завершена {
    color: #27ae60;
    font-weight: 500;
}

.role-admin {
    color: #FF8C00;
    font-weight: 500;
}

.role-user {
    color: #3498db;
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 992px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .tickets-list {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .menu {
        flex-direction: column;
        height: auto;
    }
    
    .menu a {
        height: auto;
        line-height: 1.5;
        padding: 15px 20px;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tickets-table {
        display: block;
        overflow-x: auto;
    }
    
    .status-form {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-form,
.registration-form,
.announcements,
.dashboard-container,
.admin-container {
    animation: fadeIn 0.5s ease;
}

/* Дополнительные элементы */
.notes {
    margin-top: 30px;
    padding: 20px;
    background-color: #fff8f0;
    border-radius: 8px;
    border-left: 4px solid #FF8C00;
   
}

.notes h3 {
    color: #FF8C00;
    margin-bottom: 10px;
}

.ticket-count {
    font-size: 0.9em;
    color: #777;
    font-weight: normal;
}

.actions-cell {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.current-user {
    color: #777;
    font-style: italic;
}

.admin-actions {
    margin-bottom: 30px;
}

/* Футер */
footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
    color: #777;
    border-top: 1px solid #eee;
}

.role-operator {
    color: #FF8C00;
    font-weight: 500;
}

.filter-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.2);
}

/* Адаптивность для фильтров */
@media (max-width: 768px) {
    .filter-group {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        flex-direction: column;
    }
}

/* Улучшаем внешний вид счетчиков в выпадающих списках */
select option {
    padding: 8px;
}

/* Стили для заголовка с фильтрами */
.admin-tickets h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ticket-count {
    font-size: 0.9em;
    color: #777;
    font-weight: normal;
    margin-left: auto;
}

.role-operator {
    color: #FF8C00;
    font-weight: 500;
}

.role-admin {
    color: #dc3545;
    font-weight: 500;
}

.role-user {
    color: #28a745;
    font-weight: 500;
}
/* Коды регистрации */
.status-used {
    color: #dc3545;
    font-weight: 500;
}

.status-available {
    color: #28a745;
    font-weight: 500;
}

.code-generation {
    background-color: #fff8f0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.codes-list {
    margin-top: 30px;
}

small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.9em;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 5px;
}

.pagination-link {
    display: inline-block;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination-link:hover {
    background-color: #FF8C00;
    color: white;
    border-color: #FF8C00;
}

.pagination-link.active {
    background-color: #FF8C00;
    color: white;
    border-color: #FF8C00;
    font-weight: bold;
}

.ticket-count {
    font-size: 0.9em;
    color: #777;
    font-weight: normal;
    margin-left: 10px;
}

/* Стили для скриншотов - исправление разъезжания */
.screenshot-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 10px 0;
}

.screenshot-thumb {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px;
    margin-top: 5px;
    object-fit: cover;
}

/* Для таблицы администратора */
.tickets-table .screenshot-thumb {
    max-width: 120px;
    max-height: 90px;
    display: block;
}

/* Для личного кабинета пользователя */
.ticket-item .screenshot-thumb {
    max-width: 120px;
    max-height: 90px;
}

.screenshot-link {
    display: inline-block;
    text-decoration: none;
    color: #333;
    transition: opacity 0.3s ease;
}

.screenshot-link:hover {
    opacity: 0.8;
}

.screenshot-text {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-top: 3px;
}

/* Гарантируем, что ячейки таблицы не будут растягиваться из-за контента */
.tickets-table td {
    vertical-align: top;
    max-width: 250px;
}

.tickets-table td:nth-child(6) { /* Ячейка со скриншотом */
    width: 140px;
    max-width: 140px;
}

.tickets-table td:nth-child(5) { /* Ячейка с описанием */
    max-width: 250px;
    word-wrap: break-word;
}

/* Стили для возврата заявок */
.return-ticket {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}

.return-form {
    margin-top: 10px;
    padding: 15px;
    background-color: #fff8f0;
    border-radius: 8px;
    border-left: 4px solid #FF8C00;
}

.btn-warning {
    background-color: #FF8C00;
    color: white;
}

.btn-warning:hover {
    background-color: #e67e00;
}

/* Стили для комментариев */
.ticket-comments {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}

.comment {
    padding: 10px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    border-radius: 6px;
    border-left: 3px solid #ddd;
}

.return-comment {
    border-left-color: #FF8C00;
    background-color: #fff8f0;
}

.return-label {
    display: inline-block;
    padding: 2px 6px;
    background-color: #FF8C00;
    color: white;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 10px;
}

.comment-date {
    font-size: 0.9em;
    color: #777;
}

/* Анимации для форм */
.return-form {
    animation: slideDown 0.3s ease;
}

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


/* Стили для админ-панели */
.return-count {
    display: inline-block;
    padding: 3px 8px;
    background-color: #FF8C00;
    color: white;
    border-radius: 12px;
    font-weight: bold;
}

.comments-preview {
    margin-top: 5px;
    font-size: 0.9em;
}

.comment-preview {
    padding: 5px;
    margin: 3px 0;
    background-color: #f5f5f5;
    border-radius: 4px;
    border-left: 2px solid #ddd;
}

.comment-preview.return-comment {
    border-left-color: #FF8C00;
    background-color: #fff8f0;
}

/* Стили для управления ремонтом */
.repair-settings, .repair-categories {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.add-category-form {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
}

.checkmark {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #eee;
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #FF8C00;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark:after {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Адаптивность */
@media (max-width: 768px) {
    .filter-group {
        grid-template-columns: 1fr;
    }
    
    .tickets-table {
        font-size: 0.8em;
    }
    
    .tickets-table th,
    .tickets-table td {
        padding: 8px;
    }
}

/* Стили для формы выбора типа заявки */
.ticket-type-selector {
    margin-bottom: 20px;
}

.ticket-type-option {
    display: inline-block;
    padding: 10px 20px;
    margin-right: 10px;
    background-color: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ticket-type-option:hover {
    background-color: #e9e9e9;
}

.ticket-type-option.active {
    background-color: #FF8C00;
    color: white;
    border-color: #FF8C00;
}

/* Анимация появления категорий */
.category-select {
    animation: fadeIn 0.3s ease;
}

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

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .ticket-type-option {
        display: block;
        margin-bottom: 10px;
        margin-right: 0;
    }
}

/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 400px;
    max-width: 80%;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

/* Стили для кнопок */
.btn-warning {
    background-color: #ff9800;
    color: white;
}

.btn-warning:hover {
    background-color: #e68a00;
}

.actions-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.actions-cell form,
.actions-cell button {
    margin: 2px 0;
}

.current-user {
    color: #666;
    font-style: italic;
}
.comments-section {
    margin-top: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.comment {
    margin-bottom: 15px;
    padding: 15px;
    background-color: white;
    border-radius: 5px;
    border-left: 4px solid #007bff;
}

.return-comment {
    border-left-color: #ffc107;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.comment-header strong {
    margin-right: 8px;
}

.user-role {
    margin-right: 15px;
    font-size: 0.9em;
    color: #6c757d;
}

.comment-date {
    font-size: 0.9em;
    color: #6c757d;
}

.return-label {
    margin-left: auto;
    padding: 3px 8px;
    background-color: #ffc107;
    color: #212529;
    border-radius: 3px;
    font-size: 0.8em;
}

.comment-body {
    line-height: 1.5;
}

.add-comment {
    margin-top: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 5px;
}

.back-button {
    margin-bottom: 20px;
}

.alert {
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}