.ticket-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.ticket-modal.active {
    display: block;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1f2937;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 5px;
}

.modal-body {
    padding: 20px;
}

.ticket-status-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.ticket-id {
    font-weight: 600;
    color: #4b5563;
}

.ticket-status,
.ticket-priority {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-open {
    background-color: #93c5fd;
    color: #1e40af;
}

.status-in-progress {
    background-color: #fcd34d;
    color: #92400e;
}

.status-resolved {
    background-color: #86efac;
    color: #166534;
}

.priority-high {
    background-color: #fca5a5;
    color: #991b1b;
}

.priority-medium {
    background-color: #fcd34d;
    color: #92400e;
}

.priority-low {
    background-color: #86efac;
    color: #166534;
}

.ticket-subject {
    font-size: 1.25rem;
    margin: 15px 0;
    color: #1f2937;
}

.ticket-meta {
    display: flex;
    gap: 20px;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 15px;
}

.ticket-description {
    background-color: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.ticket-attachments {
    margin-bottom: 20px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background-color: #f3f4f6;
    border-radius: 6px;
    width: fit-content;
}

.attachment-item a {
    color: #2563eb;
    text-decoration: none;
}

.ticket-history {
    margin: 30px 0;
}

.history-timeline {
    margin-top: 15px;
}

.history-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.history-icon {
    width: 32px;
    height: 32px;
    background-color: #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
}

.history-content {
    flex: 1;
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.history-type {
    font-weight: 500;
    color: #4b5563;
}

.history-date {
    color: #6b7280;
    font-size: 0.875rem;
}

.history-message {
    background-color: #f9fafb;
    padding: 10px;
    border-radius: 6px;
    white-space: pre-wrap;
}

.ticket-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.status-select,
.priority-select {
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: white;
}

.update-ticket {
    padding: 8px 16px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.update-ticket:hover {
    background-color: #1d4ed8;
}

.ticket-reply {
    margin-top: 20px;
}

.ticket-reply textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    resize: vertical;
    margin-bottom: 10px;
}

.reply-actions {
    display: flex;
    gap: 10px;
}

.add-note,
.send-reply {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.add-note {
    background-color: #f3f4f6;
    color: #4b5563;
}

.send-reply {
    background-color: #2563eb;
    color: white;
}

.add-note:hover {
    background-color: #e5e7eb;
}

.send-reply:hover {
    background-color: #1d4ed8;
}

@media (max-width: 640px) {
    .modal-content {
        width: 95%;
    }

    .ticket-status-bar,
    .ticket-actions,
    .reply-actions {
        flex-direction: column;
    }

    .ticket-status-bar > * {
        width: fit-content;
    }

    .status-select,
    .priority-select,
    .update-ticket,
    .add-note,
    .send-reply {
        width: 100%;
    }
}