/* Support Tickets - Modern Professional Design */

/* ========================================
   DEPARTMENT SELECTION
   ======================================== */

.departments {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.departments li {
    margin: 0;
}

.departments li a {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px 28px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
    box-sizing: border-box;
    box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 8px 40px rgba(0, 0, 0, 0.08);
}

.departments li a:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #67a552;
    transition: all 0.3s ease;
}

.departments li a:hover {
    box-shadow: 0 8px 24px rgba(103, 165, 82, 0.15);
    transform: translateY(-4px);
    border-color: #67a552;
    background: linear-gradient(135deg, #ffffff 0%, rgba(103, 165, 82, 0.02) 100%);
}

.departments li a:hover:before {
    width: 6px;
}

.department-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.department-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 22px;
    background: rgba(103, 165, 82, 0.1);
    color: #67a552;
}

.department-header strong {
    font-size: 17px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
    flex: 1;
}

.departments li a .description {
    display: block;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    padding-left: 64px;
}

/* ========================================
   TICKET FORM
   ======================================== */

.ticket-form {
    background: #ffffff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 8px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #f3f4f6;
}

/* Form Grid Layout */
.ticket-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.ticket-form-grid .control-group {
    margin-bottom: 0;
    min-width: 0; /* Allow grid items to shrink below min-content */
}

.ticket-form-grid .control-label {
    display: block;
    margin-bottom: 8px;
}

.ticket-form-grid .controls {
    display: block;
    min-width: 0; /* Allow controls to shrink */
}

.ticket-form-grid .controls input,
.ticket-form-grid .controls select {
    width: 100%;
    box-sizing: border-box;
}

/* Full width fields */
.ticket-form .full-width {
    grid-column: 1 / -1;
}

/* KB Suggestions */
#searchresults {
    margin-top: 20px;
    padding: 20px 24px;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.05) 0%, #ffffff 100%);
    border: 1px solid #f59e0b;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    display: none;
}

#searchresults h3 {
    font-size: 16px;
    font-weight: 600;
    color: #d97706;
    margin: 0 0 12px 0;
}

#searchresults ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#searchresults ul li {
    margin: 8px 0;
}

#searchresults ul li a {
    color: #d97706;
    text-decoration: none;
    font-weight: 500;
}

#searchresults ul li a:hover {
    text-decoration: underline;
}

/* File Upload */
.file-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-upload-item input[type="file"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    font-size: 14px;
}

.file-upload-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #67a552;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.file-upload-add:hover {
    color: #5a8f47;
}

.file-upload-add img {
    vertical-align: middle;
}

.file-upload-info {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

/* ========================================
   TICKET CONFIRMATION
   ======================================== */

.ticket-confirmation {
    text-align: center;
    padding: 40px 20px;
}

.ticket-confirmation .alert {
    margin-bottom: 30px;
}

.ticket-confirmation p {
    font-size: 15px;
    color: #4b5563;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.ticket-number {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

/* ========================================
   CAPTCHA
   ======================================== */

.captcha-section {
    background: #f9fafb;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
    border: 1px solid #e5e7eb;
}

.captcha-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.captcha-section p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px 0;
}

.captcha-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.captcha-content img {
    border-radius: 4px;
    border: 1px solid #d1d5db;
}

/* ========================================
   TICKET VIEW
   ======================================== */

/* Ticket Actions */
.ticket-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    justify-content: flex-end;
}

/* Ticket Header */
.ticket-header {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 8px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #f3f4f6;
}

.ticket-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    line-height: 1.3;
}

/* Ticket Details Grid */
.ticket-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 8px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #f3f4f6;
}

.ticket-detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ticket-detail-label {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ticket-detail-value {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

/* Custom Fields */
.ticket-custom-fields {
    margin-bottom: 20px;
}

/* Ticket Messages */
.ticket-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.ticket-message {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 8px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #f3f4f6;
}

.ticket-message--admin {
    border-left: 4px solid #67a552;
}

.ticket-message--client {
    border-left: 4px solid #3b82f6;
}

.ticket-message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
    flex-wrap: wrap;
    gap: 12px;
}

.ticket-message-author {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.ticket-message-author i {
    font-size: 20px;
    color: #67a552;
}

.ticket-message--client .ticket-message-author i {
    color: #3b82f6;
}

.ticket-message-author strong {
    color: #1f2937;
    font-weight: 600;
}

.ticket-message-role {
    color: #6b7280;
    font-size: 14px;
    font-weight: normal;
}

.ticket-message-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #6b7280;
}

.ticket-message-date i {
    font-size: 14px;
}

.ticket-message-body {
    padding: 20px 24px;
    font-size: 15px;
    line-height: 1.6;
    color: #4b5563;
}

/* Ticket Attachments */
.ticket-attachments {
    margin-top: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.ticket-attachments strong {
    display: block;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 10px;
}

.ticket-attachments strong i {
    color: #67a552;
    margin-right: 6px;
}

.ticket-attachments ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticket-attachments ul li {
    margin: 0;
}

.ticket-attachments ul li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #67a552;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.ticket-attachments ul li a:hover {
    color: #5a8f47;
    text-decoration: underline;
}

.ticket-attachments ul li a i {
    font-size: 14px;
}

/* Ticket Rating */
.ticket-rating {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    transition: opacity 0.2s ease;
}

.ticket-rating.submitting {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.ticket-rating--given {
    background: linear-gradient(90deg, rgba(103, 165, 82, 0.05) 0%, #ffffff 100%);
    border: 1px solid rgba(103, 165, 82, 0.2);
}

.ticket-rating-label {
    font-size: 14px;
    color: #4b5563;
    font-weight: 500;
}

.ticket-rating-stars {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticket-rating-stars i {
    font-size: 18px;
    color: #f59e0b;
}

.ticket-rating-star {
    cursor: pointer;
    transition: all 0.2s ease;
}

.ticket-rating-star:hover {
    transform: scale(1.2);
}

.ticket-rating-text {
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.2s ease;
}

.ticket-rating-text:hover {
    color: #1f2937;
}

/* Ticket Reply Form */
.ticket-reply-form {
    background: #ffffff;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 8px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #f3f4f6;
}

.ticket-reply-form h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ticket-reply-form h3 i {
    color: #67a552;
}

.ticket-reply-form .full-width {
    grid-column: 1 / -1;
}

/* Hide class */
.hide {
    display: none;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 991px) {
    .departments {
        grid-template-columns: 1fr;
    }

    .ticket-form {
        padding: 20px;
    }

    .ticket-form-grid {
        gap: 16px;
    }

    .ticket-details {
        grid-template-columns: 1fr 1fr;
    }

    .ticket-reply-form {
        padding: 20px;
    }
}

@media (max-width: 767px) {
    .ticket-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .departments li a {
        padding: 20px;
        gap: 14px;
    }

    .department-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .ticket-form {
        padding: 16px;
    }

    .ticket-confirmation {
        padding: 20px 16px;
    }

    .captcha-content {
        flex-direction: column;
    }

    .ticket-actions {
        flex-direction: column;
    }

    .ticket-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .ticket-header {
        padding: 16px;
    }

    .ticket-header h2 {
        font-size: 20px;
    }

    .ticket-details {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .ticket-message-header {
        padding: 12px 16px;
    }

    .ticket-message-body {
        padding: 16px;
    }

    .ticket-reply-form {
        padding: 16px;
    }

    .ticket-rating {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .departments li a {
        border: 1px solid #000;
        box-shadow: none;
    }

    .ticket-form,
    .ticket-header,
    .ticket-details,
    .ticket-message,
    .ticket-reply-form {
        box-shadow: none;
        border: 1px solid #000;
    }

    .file-upload-add,
    .form-actions,
    .ticket-actions,
    .ticket-rating {
        display: none;
    }
}
