/* Additional styles for /contact ticket section */
.auth-message {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.auth-content {
    max-width: 400px;
    margin: 0 auto;
}

.auth-content i {
    font-size: 3rem;
    background: linear-gradient(135deg, #f0a3b9, #bcaedc, #9abffd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    display: block;
}

.auth-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
}

.auth-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
}

.filters-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.filter-field {
    margin-bottom: 0 !important;
}

.filter-field .form-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 12px;
}

.filter-field .form-input:focus {
    border-color: #bcaedc;
    outline: none;
    box-shadow: 0 0 0 3px rgba(188, 174, 220, 0.1);
}

.tickets-stats {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #f0a3b9, #bcaedc, #9abffd);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #f0a3b9, #bcaedc, #9abffd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-icon.open {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

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

.stat-icon.urgent {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.stat-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.tickets-list,
.admin-tickets-list {
    min-height: 300px;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: rgba(255, 255, 255, 0.7);
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f0a3b9, #bcaedc, #9abffd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading p {
    font-size: 1.1rem;
}

.admin-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.admin-header {
    text-align: center;
    margin-bottom: 3rem;
}

.admin-header h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.admin-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

.admin-stats {
    margin-bottom: 3rem;
}

.admin-filters {
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

/* Contact page specific styling */
body[data-page="contact"] .ticket-section {
    margin-top: 0;
    padding-top: 3rem;
}

/* Ensure proper spacing between sections */
.cp-form-w+.ticket-section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 4rem;
}

/* Style adjustments for contact form integration */
.cp-form .form-input[name="company"],
.cp-form .form-input[name="phone"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.cp-form .form-input[name="company"]:focus,
.cp-form .form-input[name="phone"]:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Ensure consistent styling for new fields */
.cp-form .form-input[name="company"]::placeholder,
.cp-form .form-input[name="phone"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Toast container positioning adjustment for contact page */
body[data-page="contact"] #toast-container {
    top: 100px;
    /* Account for header */
}

/* Responsive improvements */
@media (max-width: 768px) {
    .cp-form-w+.ticket-section {
        margin-top: 2rem;
    }

    body[data-page="contact"] .ticket-section {
        padding-top: 2rem;
    }

    .ticket-tabs {
        gap: 1rem;
    }

    .tab-btn {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }

    .filters-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .section__title {
        font-size: 2.5rem;
    }

    .section__subtitle {
        font-size: 1.1rem;
    }
}

/* Override for contact page specific spacing */
.contact-page .ticket-section {
    padding-top: 2rem;
}

/* Form input overrides for ticket forms */
.ticket-section .form-input {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
}

.ticket-section .form-input:focus {
    border-color: #bcaedc !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(188, 174, 220, 0.1) !important;
}

.ticket-section .form-input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.ticket-section .text-small {
    color: rgba(255, 255, 255, 0.9) !important;
}

.ticket-section .form-line {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Final styling adjustments */
.ticket-section .cp-form-w {
    max-width: 800px;
    margin: 0 auto;
}

/* Ensure proper form field styling in ticket section */
.ticket-section .form-field-w .text-small.caps {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Button styling consistency */
.ticket-section .btn-w {
    background: linear-gradient(135deg, #f0a3b9, #bcaedc, #9abffd);
    border: none;
    transition: all 0.3s ease;
}

.ticket-section .btn-w:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 163, 185, 0.3);
}

/* Loading spinner animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.bx-spin {
    animation: spin 2s linear infinite;
}

/* Ensure proper z-index stacking */
.toast-container {
    z-index: 10001;
}

.ticket-section {
    position: relative;
    z-index: 1;
}

/* Contact form success/error message styling */
.success-message,
.error-message {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.success-message {
    border-color: rgba(40, 167, 69, 0.3);
    background: rgba(40, 167, 69, 0.1);
}

.error-message {
    border-color: rgba(220, 53, 69, 0.3);
    background: rgba(220, 53, 69, 0.1);
}

/* Modal styles */
.ticket-modal,
.resolution-modal,
.confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ticket-modal.show,
.resolution-modal.show,
.confirm-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

.ticket-modal-content,
.resolution-modal-content,
.confirm-modal-content {
    background: rgba(30, 32, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.ticket-modal-header,
.resolution-modal-header,
.confirm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ticket-modal-header h3,
.resolution-modal-header h3,
.confirm-modal-header h3 {
    color: #ffffff;
    margin: 0;
    font-size: 1.5rem;
}

.ticket-modal-close,
.resolution-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.ticket-modal-close:hover,
.resolution-modal-close:hover {
    color: #FF4D5A;
    background: rgba(255, 77, 90, 0.15);
}

.resolution-modal-actions,
.confirm-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-w.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.btn-w.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-w.danger {
    background: linear-gradient(135deg, #f0a3b9, #bcaedc, #9abffd);
}

.btn-w.danger:hover {
    background: linear-gradient(135deg, #bcaedc, #9abffd, #f0a3b9);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(188, 174, 220, 0.3);
}

/* Form select styling for ticket forms */
.ticket-section select.form-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 12px;
    padding: 0.5rem 1rem;
}

.ticket-section select.form-input option {
    background: #1a1a1a;
    color: #ffffff;
}

/* Additional modal backdrop styling */
.ticket-modal.show .ticket-modal-content,
.resolution-modal.show .resolution-modal-content,
.confirm-modal.show .confirm-modal-content {
    animation: modalSlideIn 0.3s ease forwards;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(30px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Boxicons integration */
.bx {
    font-family: boxicons !important;
}

@font-face {
    font-family: 'boxicons';
    src: url('https://unpkg.com/boxicons@2.1.4/fonts/boxicons.eot');
    src: url('https://unpkg.com/boxicons@2.1.4/fonts/boxicons.eot#iefix') format('embedded-opentype'),
        url('https://unpkg.com/boxicons@2.1.4/fonts/boxicons.woff2') format('woff2'),
        url('https://unpkg.com/boxicons@2.1.4/fonts/boxicons.woff') format('woff'),
        url('https://unpkg.com/boxicons@2.1.4/fonts/boxicons.ttf') format('truetype'),
        url('https://unpkg.com/boxicons@2.1.4/fonts/boxicons.svg#boxicons') format('svg');
    font-weight: normal;
    font-style: normal;
}

.bx:before {
    content: attr(data-icon);
}

.bx-plus-circle:before {
    content: '\ea13';
}

.bx-list-ul:before {
    content: '\ea8c';
}

.bx-shield-quarter:before {
    content: '\ebf7';
}

.bx-lock-alt:before {
    content: '\ea6a';
}

.bx-loader-alt:before {
    content: '\ea69';
}

.bx-time:before {
    content: '\ec0c';
}

.bx-check-circle:before {
    content: '\ea21';
}

/* Ticket Modal Styles */
.ticket-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ticket-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

.ticket-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.ticket-modal-content {
    background: rgba(30, 32, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.ticket-modal.show .ticket-modal-content {
    transform: scale(1);
}

.ticket-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ticket-modal-header h3 {
    color: #ffffff;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
}

.modal-close:hover {
    background: rgba(255, 77, 90, 0.15);
    color: #FF4D5A;
    transform: rotate(90deg);
}

.ticket-modal-body {
    padding: 30px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.ticket-details .detail-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 25px;
}

.ticket-details .detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.ticket-details .detail-item strong {
    color: #ffffff;
    min-width: 120px;
}

.ticket-details .status-badge,
.ticket-details .priority-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-details .status-badge.open {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.ticket-details .status-badge.in-progress {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

.ticket-details .status-badge.resolved {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.ticket-details .status-badge.closed {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.ticket-details .priority-badge.low {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.ticket-details .priority-badge.medium {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.ticket-details .priority-badge.high {
    background: rgba(255, 108, 36, 0.2);
    color: #ff6c24;
    border: 1px solid rgba(255, 108, 36, 0.3);
}

.ticket-details .priority-badge.urgent {
    background: rgba(240, 163, 185, 0.2);
    background: linear-gradient(135deg, #f0a3b9, #bcaedc, #9abffd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border: 1px solid rgba(188, 174, 220, 0.3);
}

.ticket-description {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    line-height: 1.6;
}

.admin-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-actions .btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.admin-actions .btn.resolve {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.admin-actions .btn.resolve:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.admin-actions .btn.close {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.admin-actions .btn.close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.3);
}

/* Close modal when clicking overlay */
.ticket-modal-overlay {
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ticket-modal-content {
        width: 95%;
        margin: 20px;
    }

    .ticket-modal-header,
    .ticket-modal-body {
        padding: 20px;
    }

    .ticket-details .detail-grid {
        grid-template-columns: 1fr;
    }

    .admin-actions {
        flex-direction: column;
    }
}

/* Light mode text colors for contact ticket section */
html.light .auth-message {
    color: rgba(0, 0, 0, 0.9) !important;
}

html.light .auth-content h3 {
    color: rgba(0, 0, 0, 0.9) !important;
}

html.light .auth-content p {
    color: rgba(0, 0, 0, 0.8) !important;
}

html.light .loading {
    color: rgba(0, 0, 0, 0.7) !important;
}

html.light .ticket-section .form-field-w .text-small.caps {
    color: rgba(0, 0, 0, 0.9) !important;
}

html.light .ticket-section .form-input {
    color: rgba(0, 0, 0, 0.9) !important;
}

html.light .ticket-section .form-input::placeholder {
    color: rgba(0, 0, 0, 0.5) !important;
}

html.light .stat-number {
    color: rgba(0, 0, 0, 0.9) !important;
}

html.light .stat-label {
    color: rgba(0, 0, 0, 0.6) !important;
}

html.light .btn-w.secondary {
    color: rgba(0, 0, 0, 0.9) !important;
}

html.light .ticket-details {
    color: rgba(0, 0, 0, 0.9) !important;
}

html.light .ticket-meta {
    color: rgba(0, 0, 0, 0.6) !important;
}

html.light .admin-actions .btn {
    color: white !important; /* Keep button text white for contrast */
}