/* Support Module CSS File */

.support-container {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.support-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    padding-left: 0;
    padding-right: 0;
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    padding-left: 0;
}

.header-content .text-muted {
    color: #6b7280;
    margin-top: 0.25rem;
}

.header-actions .btn-primary {
    background-color: #2563eb;
    border-color: #2563eb;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.header-actions .btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.filter-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

.form-select {
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    appearance: none;
    min-width: 140px;
}

.search-container {
    min-width: 240px;
}

.search-container .input-group {
    display: flex;
}

.search-container .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.search-container .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background-color: #fff;
    border-color: #ced4da;
    border-left: none;
}

/* More compact overview cards */
.tickets-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    margin-left: 0;
    margin-right: 0;
}

.overview-card {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: #fff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.overview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    margin-right: 0.75rem;
    font-size: 1rem;
}

.overview-data h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.overview-data p {
    margin: 0;
    color: #6b7280;
    font-size: 0.75rem;
}

.overview-card.new .overview-icon {
    background-color: rgba(23, 162, 184, 0.15);
    color: #17a2b8;
}

.overview-card.in-progress .overview-icon {
    background-color: rgba(0, 123, 255, 0.15);
    color: #007bff;
}

.overview-card.waiting .overview-icon {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.overview-card.resolved .overview-icon {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.tickets-container {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.tickets-table {
    margin-bottom: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* Smaller table header */
.tickets-table thead th {
    background-color: #f3f4f6;
    color: #374151;
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    vertical-align: middle;
}

.tickets-table tbody tr {
    transition: background-color 0.2s ease;
    position: relative; /* Important for dropdown positioning */
}

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

/* More compact table cells */
.tickets-table tbody td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #e5e7eb;
}

.tickets-table .ticket-row.overdue {
    background-color: #fff5f5;
}

.tickets-table .ticket-row.overdue:hover {
    background-color: #fee2e2;
}

.title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Smaller title text */
.title-text {
    font-weight: 500;
    color: #111827;
    font-size: 0.85rem;
}

.attachment-badge, .comment-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background-color: #f3f4f6;
    color: #6b7280;
}

.queue-label {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background-color: #e5e7eb;
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Adjust date display */
.date-wrapper {
    display: flex;
    flex-direction: column;
}

.date-wrapper .date {
    font-weight: 500;
    color: #374151;
    font-size: 0.8rem;
}

.date-wrapper .time {
    font-size: 0.7rem;
    color: #6b7280;
}

/* Column alignments */
.tickets-table th.ticket-id,
.tickets-table td.ticket-id {
    text-align: left;
    padding-left: 1.25rem;
}

.tickets-table th.ticket-status,
.tickets-table td.ticket-status,
.tickets-table th.ticket-priority,
.tickets-table td.ticket-priority,
.tickets-table th.ticket-queue,
.tickets-table td.ticket-queue {
    text-align: left;
}

.tickets-table th.ticket-created,
.tickets-table td.ticket-created,
.tickets-table th.ticket-updated,
.tickets-table td.ticket-updated {
    text-align: left;
}

/* Make action column more compact */
.tickets-table th.ticket-actions,
.tickets-table td.ticket-actions {
    text-align: right;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    position: relative;
    white-space: nowrap;
    width: 1%;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Smaller view buttons */
.tickets-table .action-buttons .btn,
.tickets-table .action-view {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 0.2rem;
    height: auto;
    min-height: 24px;
}

/* Make the eye icon smaller */
.tickets-table .action-buttons .btn svg,
.tickets-table .action-buttons .btn i {
    font-size: 0.8rem;
    width: 0.8rem;
    height: 0.8rem;
    margin-right: 0.2rem;
}

/* Adjust the menu button (three dots) */
.action-menu {
    padding: 0.15rem 0.25rem;
    font-size: 0.75rem;
    height: 24px;
    width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: pointer;
    margin-left: 0.25rem;
    transition: background-color 0.2s;
}

.action-menu:hover {
    background-color: #e9ecef;
}

/* Make sure table container doesn't clip dropdowns */
.table-responsive {
    overflow: visible;
}

/* Smaller status and priority badges */
.status-badge, .priority-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-new {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-in_progress {
    background-color: #e0f2fe;
    color: #0369a1;
}

.badge-waiting {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-resolved {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-closed {
    background-color: #f3f4f6;
    color: #6b7280;
}

.badge-low {
    background-color: #dcfce7;
    color: #166534;
}

.badge-medium {
    background-color: #e0f2fe;
    color: #0369a1;
}

.badge-high {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-urgent {
    background-color: #fee2e2;
    color: #b91c1c;
}

.pagination-container {
    display: flex;
    justify-content: center;
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item {
    margin: 0 0.25rem;
}

.page-link {
    display: block;
    padding: 0.375rem 0.75rem;
    color: #3b82f6;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-item.active .page-link {
    background-color: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.page-item.disabled .page-link {
    color: #9ca3af;
    pointer-events: none;
    background-color: #fff;
    border-color: #e5e7eb;
}

/* Enhanced Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    text-align: center;
}

.empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background-color: #f3f4f6;
    color: #9ca3af;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* Enhanced Create Ticket Button for Empty State */
.empty-state .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: #2563eb;
    color: white !important;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    text-decoration: none !important;
    margin-top: 0.5rem;
}

.empty-state .btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 10px -1px rgba(37, 99, 235, 0.25);
}

.empty-state .btn-primary:active {
    transform: translateY(0px);
    box-shadow: 0 2px 4px -1px rgba(37, 99, 235, 0.2);
}

.empty-state .btn-primary i, 
.empty-state .btn-primary svg {
    display: none !important;
}

/* Ticket Detail Page Styles */
.ticket-container {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .ticket-container {
        grid-template-columns: 1fr;
    }
}

.ticket-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ticket-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ticket-section {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.ticket-section-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.ticket-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.ticket-section-content {
    padding: 1.5rem;
}

.ticket-section-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.ticket-header-content {
    flex: 1;
}

.ticket-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.ticket-submitter {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.back-link {
    margin-top: 0.75rem;
}

.back-link .btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
    color: #4b5563;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.back-link .btn:hover {
    background-color: #f3f4f6;
    color: #111827;
    border-color: #9ca3af;
}

.back-link .btn i {
    margin-right: 0.35rem;
}

.ticket-status-badge {
    margin-left: 1rem;
}

.ticket-description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.ticket-actions-bar {
    display: flex;
    justify-content: flex-start;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.ticket-info-list {
    padding: 0.5rem 0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #6b7280;
    font-weight: 500;
}

.info-value {
    color: #111827;
    font-weight: 600;
}

.status-value-new, .priority-value-low {
    color: #3b82f6;
}

.status-value-in_progress, .priority-value-medium {
    color: #0ea5e9;
}

.status-value-waiting, .priority-value-high {
    color: #f59e0b;
}

.status-value-resolved, .priority-value-urgent {
    color: #10b981;
}

.status-value-closed {
    color: #6b7280;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.comment {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    border-left: 3px solid #3b82f6;
    padding: 1.25rem;
}

.private-comment {
    background-color: #fff7ed;
    border-left-color: #f59e0b;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-avatar {
    font-size: 1.25rem;
    color: #6b7280;
}

.author-name {
    font-weight: 600;
    color: #111827;
}

.comment-timestamp {
    color: #6b7280;
    font-size: 0.875rem;
}

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

.private-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.75rem;
    padding: 0.25rem 0.5rem;
    background-color: #fff3e0;
    color: #f59e0b;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.empty-comments {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 2rem 0;
}

.comment-form-wrapper {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.comment-form .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.private-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.submit-comment {
    margin-top: 0.5rem;
}

.related-tickets-list {
    padding: 0.5rem 0;
}

.related-ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.related-ticket-item:last-child {
    border-bottom: none;
}

.related-ticket-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #3b82f6;
    text-decoration: none;
    max-width: 80%;
}

.related-ticket-link:hover {
    text-decoration: underline;
}

.related-ticket-id {
    color: #6b7280;
    font-weight: 500;
}

.related-ticket-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-ticket-status {
    font-size: 0.75rem;
}

.empty-related-tickets {
    padding: 1.5rem;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

.attachments-list {
    margin-bottom: 20px;
}

.attachment-item {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f9f9f9;
}

.attachment-icon {
    margin-right: 15px;
    font-size: 24px;
    color: #6c757d;
    display: flex;
    align-items: center;
}

.attachment-details {
    flex-grow: 1;
}

.attachment-filename {
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
}

.attachment-meta {
    display: flex;
    font-size: 0.8rem;
    color: #6c757d;
    flex-wrap: wrap;
}

.attachment-meta > * {
    margin-right: 15px;
}

.attachment-delete {
    color: #dc3545;
}

.attachment-delete:hover {
    text-decoration: none;
    color: #bd2130;
}

.upload-form-wrapper {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.custom-file-input-wrapper {
    display: flex;
    gap: 10px;
}

.empty-attachments {
    color: #6c757d;
    font-style: italic;
}

.notification-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 350px;
}

.notification {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 0.375rem;
    background-color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    animation: slide-in 0.3s ease-out forwards;
    overflow: hidden;
    max-width: 100%;
}

.notification-hiding {
    animation: slide-out 0.3s ease-in forwards;
}

.notification-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.notification-success .notification-icon {
    color: #059669;
}

.notification-error .notification-icon {
    color: #dc2626;
}

.notification-content {
    flex: 1;
}

.notification-content p {
    margin: 0;
    color: #1f2937;
}

.notification-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: 0.5rem;
    padding: 0;
    line-height: 1;
}

.notification-close:hover {
    color: #4b5563;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.rotating {
    animation: rotate 1s linear;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.ticket-row {
    transition: background-color 0.2s ease;
}

.ticket-row.highlight {
    background-color: rgba(59, 130, 246, 0.05) !important;
}

/* Support ticket modal styles */
.support-ticket-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1001;
}

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

.modal-body {
    padding: 20px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* Critical dropdown fixes */
.ticket-actions {
    position: static !important; /* Override any relative positioning */
}

/* Make sure parent containers don't clip content */
.table-responsive, 
.tickets-container, 
.tickets-table,
.ticket-row,
.ticket-actions,
tbody, tr, td {
    overflow: visible !important;
}

/* Mobile responsive adjustments for buttons */
@media (max-width: 768px) {
    .tickets-table .action-buttons .btn-text {
        display: none; /* Hide button text on mobile, show only icon */
    }
    
    .tickets-table .action-buttons .btn svg,
    .tickets-table .action-buttons .btn i {
        margin-right: 0;
    }
    
    .tickets-table .action-buttons .btn {
        padding: 0.25rem;
        width: 24px;
        height: 24px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}