html {
    overflow-y: scroll;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

html::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    display: none;
}

.tickets-section {
    background: rgba(26, 26, 26, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 51, 51, 0.15);
    overflow: hidden;
    min-height: 600px;
}

.tickets-container {
    display: flex;
    height: 600px;
}

/* Панель со списком тикетов */
.tickets-list-panel {
    width: 320px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.tickets-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.tickets-header h3 {
    font-size: 16px;
    color: #fff;
    margin: 0;
}

.tickets-header h3 i {
    color: #ff6666;
    margin-right: 8px;
}

.tickets-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    max-height: calc(100% - 60px);
}

/* Кастомный скроллбар для всех браузеров */
.tickets-list,
.chat-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 51, 51, 0.5) rgba(255, 255, 255, 0.05);
}

.tickets-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.tickets-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.tickets-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 51, 51, 0.5);
    border-radius: 3px;
    transition: background 0.2s;
}

.tickets-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 51, 51, 0.8);
}

/* Для Firefox */
.tickets-list,
.chat-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 51, 51, 0.5) rgba(255, 255, 255, 0.05);
}

/* Для Edge и IE */
.tickets-list,
.chat-messages {
    -ms-overflow-style: -ms-autohiding-scrollbar;
}

.ticket-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.ticket-item:hover {
    background: rgba(255, 51, 51, 0.1);
    transform: translateX(2px);
}

.ticket-item.active {
    background: rgba(255, 51, 51, 0.15);
    border-color: rgba(255, 51, 51, 0.3);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ticket-id {
    font-weight: bold;
    color: #ff6666;
    font-size: 13px;
}

.ticket-status {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
}

.ticket-status.open {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.ticket-status.work {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.ticket-status.closed {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
    border: 1px solid #9e9e9e;
}

.ticket-title {
    font-size: 14px;
    color: #e0e0e0;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-last-msg {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-time {
    font-size: 10px;
    color: #666;
    margin-top: 8px;
}

/* Empty state - по центру с компактной кнопкой */
.empty-state-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.empty-state-content {
    text-align: center;
    padding: 30px;
}

.empty-state-content i {
    font-size: 56px;
    color: #ff6666;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state-content p {
    color: #888;
    margin-bottom: 20px;
    font-size: 14px;
}

.create-ticket-btn-large {
    background: rgba(255, 51, 51, 0.15);
    border: 1px solid rgba(255, 51, 51, 0.3);
    color: #ff6666;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.create-ticket-btn-large:hover {
    background: rgba(255, 51, 51, 0.3);
    transform: translateY(-1px);
}

/* Чат панель */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.back-to-list {
    background: none;
    border: none;
    color: #ff6666;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    display: none;
}

.back-to-list:hover {
    transform: translateX(-2px);
}

.chat-title {
    flex: 1;
}

.chat-title h3 {
    font-size: 16px;
    color: #fff;
    margin: 0 0 5px 0;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.close-ticket-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.close-ticket-btn:hover {
    background: rgba(220, 53, 69, 0.4);
    transform: translateY(-1px);
}

/* Сообщения чата */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-item {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.message-item.own {
    align-self: flex-end;
}

.message-item.other {
    align-self: flex-start;
}

.message-bubble {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 10px 15px;
    position: relative;
}

.message-item.own .message-bubble {
    background: linear-gradient(135deg, rgba(255, 51, 51, 0.2), rgba(204, 0, 0, 0.2));
    border: 1px solid rgba(255, 51, 51, 0.3);
}

.message-sender {
    font-size: 11px;
    color: #ff6666;
    margin-bottom: 5px;
    font-weight: bold;
}

.message-text {
    font-size: 14px;
    color: #e0e0e0;
    word-break: break-word;
    white-space: pre-wrap;
}

.message-attachment {
    margin-top: 8px;
}

.message-attachment a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ff6666;
    text-decoration: none;
    font-size: 12px;
    padding: 5px 10px;
    background: rgba(255, 51, 51, 0.1);
    border-radius: 8px;
}

.message-attachment a:hover {
    background: rgba(255, 51, 51, 0.2);
}

.message-attachment img,
.message-attachment video {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    margin-top: 5px;
}

.message-time {
    font-size: 10px;
    color: #666;
    margin-top: 5px;
    padding-left: 10px;
}

/* Область ввода */
.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.file-preview {
    background: rgba(255, 51, 51, 0.1);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 10px;
}

.preview-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-content i {
    color: #ff6666;
}

.preview-content span {
    flex: 1;
    font-size: 12px;
    color: #e0e0e0;
}

.remove-file {
    background: none;
    border: none;
    color: #ff6666;
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-wrapper textarea {
    flex: 1;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 10px 15px;
    color: #e0e0e0;
    font-size: 14px;
    resize: none;
    font-family: inherit;
}

.input-wrapper textarea:focus {
    outline: none;
    border-color: #ff3333;
}

.input-buttons {
    display: flex;
    gap: 8px;
}

.attach-btn {
    background: rgba(255, 51, 51, 0.2);
    border: 1px solid rgba(255, 51, 51, 0.3);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.attach-btn:hover {
    background: rgba(255, 51, 51, 0.4);
    transform: scale(1.05);
}

.attach-btn i {
    color: #ff6666;
    font-size: 16px;
}

.send-btn {
    background: linear-gradient(135deg, #ff3333, #cc0000);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(255, 51, 51, 0.4);
}

.send-btn i {
    color: white;
    font-size: 14px;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #888;
}

.loading-spinner i {
    margin-right: 8px;
}

/* Модальное окно создания тикета */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-container {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    border: 1px solid rgba(255, 51, 51, 0.3);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 18px;
}

.modal-header h3 i {
    color: #ff6666;
    margin-right: 8px;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ff6666;
}

.modal-body {
    padding: 20px;
}

.modal-body input,
.modal-body textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #e0e0e0;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.modal-body textarea {
    resize: vertical;
    font-family: inherit;
}

.modal-body input:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: #ff3333;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-footer button {
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #e0e0e0;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.create-btn {
    background: linear-gradient(135deg, #ff3333, #cc0000);
    border: none;
    color: white;
}

.create-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 51, 51, 0.4);
}

/* Модальное окно подтверждения */
.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
}

.confirm-modal-container {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    width: 90%;
    max-width: 380px;
    border: 1px solid rgba(255, 51, 51, 0.3);
    overflow: hidden;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.confirm-modal-header {
    padding: 25px 20px 15px;
}

.confirm-modal-header i {
    font-size: 56px;
    color: #dc3545;
    margin-bottom: 15px;
}

.confirm-modal-header h3 {
    color: #fff;
    margin: 0 0 10px;
    font-size: 20px;
}

.confirm-modal-header p {
    color: #888;
    margin: 0;
    font-size: 14px;
}

.confirm-modal-footer {
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.confirm-modal-footer button {
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border: none;
}

.confirm-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.confirm-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.confirm-ok-btn {
    background: linear-gradient(135deg, #dc3545, #a71d2a);
    color: white;
}

.confirm-ok-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.4);
}

/* Уведомления */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid #ff3333;
    z-index: 1001;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.notification.success {
    border-left-color: #4caf50;
}

.notification.error {
    border-left-color: #ff3333;
}

.notification i {
    font-size: 18px;
}

.notification.success i {
    color: #4caf50;
}

.notification.error i {
    color: #ff3333;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Кнопка создания тикета внизу списка */
.create-ticket-bottom {
    padding: 12px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.create-ticket-bottom-btn {
    width: 100%;
    background: rgba(255, 51, 51, 0.15);
    border: 1px solid rgba(255, 51, 51, 0.3);
    color: #ff6666;
    padding: 10px;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.create-ticket-bottom-btn:hover {
    background: rgba(255, 51, 51, 0.3);
    transform: translateY(-1px);
}

/* Адаптив */
@media (max-width: 768px) {
    .tickets-container {
        flex-direction: column;
    }
    
    .tickets-list-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        height: 100%;
        min-height: 400px;
    }
    
    .chat-panel {
        min-height: 500px;
    }
    
    .back-to-list {
        display: block;
    }
    
    .message-item {
        max-width: 85%;
    }
    
    .empty-state-content {
        padding: 20px;
    }
    
    .empty-state-content i {
        font-size: 48px;
    }
    
    .modal-container,
    .confirm-modal-container {
        width: 95%;
        max-width: 350px;
    }
}

@media (max-width: 480px) {
    .chat-header {
        flex-wrap: wrap;
    }
    
    .chat-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .message-item {
        max-width: 95%;
    }
}

.delete-ticket-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: rgba(255, 51, 51, 0.2);
    color: #ff6666;
    border: 1px solid #ff6666;
}

.delete-ticket-btn:hover {
    background: rgba(255, 51, 51, 0.4);
    transform: translateY(-1px);
}