@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Syne:wght@400;600;700;800&display=swap');

.ticket-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    font-family: 'Syne', sans-serif;
}

.auth-required {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background: #0d0d0f;
    border-radius: 4px;
    padding: 3rem;
    text-align: center;
    border: 1px solid #2a2a2e;
    outline: 4px solid #1a1a1e;
    max-width: 460px;
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 2rem;
    right: 2rem;
    height: 2px;
    background: linear-gradient(90deg, transparent, #7c3aed, transparent);
}

.auth-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    filter: grayscale(0.3);
}

.auth-card h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    color: #f0f0f0;
    letter-spacing: -0.03em;
}

.auth-card p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.btn-auth {
    display: inline-block;
    background: #7c3aed;
    color: #fff;
    padding: 0.9rem 2rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 3px;
    transition: background 0.2s, transform 0.15s;
}

.btn-auth:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #1e1e22;
}

.ticket-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #f0f0f0;
    letter-spacing: -0.04em;
}

.btn-create-ticket {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 0.85rem 1.8rem;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Syne', sans-serif;
}

.btn-create-ticket:hover {
    background: #6d28d9;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.tickets-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid #2a2a2e;
    color: #666;
    padding: 0.6rem 1.2rem;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
}

.filter-btn:hover {
    border-color: #7c3aed;
    color: #c4b5fd;
    background: rgba(124, 58, 237, 0.05);
}

.filter-btn.active {
    background: rgba(124, 58, 237, 0.15);
    border-color: #7c3aed;
    color: #a78bfa;
}

.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1px;
    background: #1a1a1e;
    border: 1px solid #1a1a1e;
    border-radius: 4px;
    overflow: hidden;
}

.ticket-card {
    background: #0d0d0f;
    transition: background 0.2s ease;
    position: relative;
}

.ticket-card:hover {
    background: #111114;
}

.ticket-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: transparent;
    transition: background 0.2s;
}

.ticket-card:hover::after {
    background: #7c3aed;
}

.ticket-card-header {
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1a1a1e;
}

.ticket-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    letter-spacing: 0.05em;
}

.ticket-status {
    padding: 0.3rem 0.8rem;
    border-radius: 2px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
}

.status-open {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-in_progress {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-resolved {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.status-closed {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.ticket-card-body {
    padding: 1.5rem;
}

.ticket-card-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: #e0e0e0;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.ticket-category {
    color: #444;
    font-size: 0.78rem;
    margin-bottom: 1rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ticket-message {
    color: #555;
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticket-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #3a3a3e;
    font-family: 'JetBrains Mono', monospace;
    padding-top: 1rem;
    border-top: 1px solid #1a1a1e;
}

.ticket-card-footer {
    padding: 0 1.5rem 1.5rem;
}

.btn-view-ticket {
    display: block;
    width: 100%;
    background: transparent;
    color: #7c3aed;
    text-align: center;
    padding: 0.75rem;
    border-radius: 2px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid #2a1f4e;
    transition: all 0.2s ease;
    font-family: 'Syne', sans-serif;
}

.btn-view-ticket:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: #7c3aed;
    color: #a78bfa;
}

.no-tickets {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
    background: #0d0d0f;
}

.no-tickets-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.2;
    filter: grayscale(1);
}

.no-tickets h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #333;
    letter-spacing: -0.03em;
}

.no-tickets p {
    color: #333;
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #0d0d0f;
    border-radius: 4px;
    width: 90%;
    max-width: 560px;
    border: 1px solid #2a2a2e;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px #1a1a1e;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 1.8rem 2rem;
    border-bottom: 1px solid #1a1a1e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #f0f0f0;
    letter-spacing: -0.03em;
}

.close {
    font-size: 1.5rem;
    color: #444;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
    font-family: 'JetBrains Mono', monospace;
}

.close:hover {
    color: #f0f0f0;
}

form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: #080809;
    border: 1px solid #2a2a2e;
    border-radius: 3px;
    color: #e0e0e0;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    font-family: 'Syne', sans-serif;
    box-sizing: border-box;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #333;
}

.form-group select option {
    background: #0d0d0f;
    color: #e0e0e0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #7c3aed;
    background: #0a0a0c;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: 'Syne', sans-serif;
    line-height: 1.6;
}

.form-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid #1a1a1e;
    margin-top: 0.5rem;
}

.btn-cancel {
    background: transparent;
    border: 1px solid #2a2a2e;
    color: #555;
    padding: 0.8rem 1.6rem;
    border-radius: 3px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Syne', sans-serif;
}

.btn-cancel:hover {
    border-color: #444;
    color: #aaa;
}

.btn-submit {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 3px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Syne', sans-serif;
}

.btn-submit:hover {
    background: #6d28d9;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.ticket-view-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    font-family: 'Syne', sans-serif;
}

.back-link {
    margin-bottom: 2rem;
}

.back-link a {
    color: #555;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.back-link a:hover {
    color: #a78bfa;
    transform: translateX(-3px);
}

.ticket-view-header {
    background: #0d0d0f;
    border-radius: 4px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #1e1e22;
    position: relative;
    overflow: hidden;
}

.ticket-view-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, #7c3aed, transparent);
}

.ticket-view-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.ticket-view-title h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #f0f0f0;
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.ticket-view-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: #444;
    flex-wrap: wrap;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.ticket-category-badge {
    background: rgba(124, 58, 237, 0.1);
    color: #a78bfa;
    padding: 0.4rem 0.9rem;
    border-radius: 2px;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid rgba(124, 58, 237, 0.2);
    font-family: 'JetBrains Mono', monospace;
}

.ticket-view-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

.ticket-main {
    background: #0d0d0f;
    border-radius: 4px;
    padding: 2rem;
    border: 1px solid #1e1e22;
}

.ticket-message-list {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #111114;
    border: 1px solid #1a1a1e;
    border-radius: 3px;
    overflow: hidden;
}

.user-message,
.admin-message {
    background: #0d0d0f;
    padding: 1.5rem;
    position: relative;
    transition: background 0.15s;
}

.user-message:hover,
.admin-message:hover {
    background: #0f0f12;
}

.admin-message {
    border-left: 2px solid #7c3aed;
}

.message-header {
    margin-bottom: 1rem;
}

.message-author {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #2a2a2e;
}

.author-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #d0d0d0;
}

.admin-badge {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    font-size: 0.7rem;
    margin-left: 0.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(245, 158, 11, 0.2);
    font-family: 'JetBrains Mono', monospace;
}

.message-date {
    font-size: 0.75rem;
    color: #333;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 0.25rem;
}

.message-body h3 {
    font-size: 1rem;
    margin-bottom: 0.6rem;
    font-weight: 700;
    color: #d0d0d0;
    letter-spacing: -0.02em;
}

.message-body p {
    color: #666;
    line-height: 1.7;
    font-size: 0.9rem;
}

.ticket-reply-form {
    border-top: 1px solid #1a1a1e;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.ticket-closed-notice {
    text-align: center;
    padding: 1.5rem;
    background: rgba(107, 114, 128, 0.05);
    border-radius: 3px;
    color: #444;
    font-size: 0.85rem;
    border: 1px solid #1e1e22;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.03em;
}

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

.ticket-info-card,
.ticket-actions-card {
    background: #0d0d0f;
    border-radius: 4px;
    padding: 1.5rem;
    border: 1px solid #1e1e22;
}

.ticket-info-card h3,
.ticket-actions-card h3 {
    margin-bottom: 1.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #444;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #1a1a1e;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0;
    border-bottom: 1px solid #111114;
}

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

.info-label {
    color: #444;
    font-weight: 600;
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
}

.info-value {
    color: #888;
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', monospace;
}

.btn-action {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
    background: transparent;
    border: 1px solid #2a2a2e;
    color: #888;
    border-radius: 3px;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Syne', sans-serif;
    text-align: center;
}

.btn-action:hover {
    border-color: #7c3aed;
    color: #a78bfa;
    background: rgba(124, 58, 237, 0.06);
}

.btn-action:last-child {
    margin-bottom: 0;
}

.btn-action.btn-danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.btn-action.btn-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: #ef4444;
}

.reply-textarea {
    width: 100%;
    background: #080809;
    border: 1px solid #2a2a2e;
    border-radius: 3px;
    color: #e0e0e0;
    padding: 1rem;
    font-size: 0.9rem;
    font-family: 'Syne', sans-serif;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.reply-textarea::placeholder {
    color: #333;
}

.reply-textarea:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.btn-reply {
    margin-top: 0.8rem;
    background: #7c3aed;
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 3px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Syne', sans-serif;
}

.btn-reply:hover {
    background: #6d28d9;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

@media (max-width: 1024px) {
    .ticket-view-content {
        grid-template-columns: 1fr;
    }

    .ticket-sidebar {
        order: -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .ticket-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .btn-create-ticket {
        justify-content: center;
    }

    .tickets-grid {
        grid-template-columns: 1fr;
    }

    .ticket-view-title {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .tickets-filter {
        gap: 0.4rem;
    }

    .filter-btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.72rem;
    }
}