/**
 * Support Ticket Styles
 */

/* Container */
.dst-container {
    max-width: 100%;
    margin-bottom: 30px;
}

/* Form Styling */
.dst-form {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    padding: 20px;
    border-radius: 4px;
}

.dst-form-row {
    margin-bottom: 15px;
}

.dst-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.dst-form-row input[type="text"],
.dst-form-row select,
.dst-form-row textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.dst-form-row textarea {
    min-height: 100px;
    resize: vertical;
}

/* File Upload Area */
.dst-file-upload-area {
    border: 2px dashed #ddd;
    padding: 20px;
    text-align: center;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #fcfcfc;
}

.dst-upload-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #f7f7f7;
    color: #555;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
}

.dst-upload-btn:hover {
    background: #f0f0f0;
}

.dst-upload-help {
    color: #777;
    font-size: 0.85em;
    margin-top: 5px;
}

/* File Preview */
.dst-file-preview {
    display: flex;
    flex-wrap: wrap;
    margin: 10px -5px;
}

.dst-attachment-preview {
    position: relative;
    width: calc(20% - 10px);
    margin: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.dst-attachment-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.dst-attachment-name {
    padding: 5px;
    font-size: 0.8em;
    background: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.dst-remove-attachment {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    line-height: 1;
    font-size: 14px;
    cursor: pointer;
    border-radius: 0 0 0 4px;
}

/* Upload Progress */
.dst-upload-progress {
    margin: 10px 0;
}

.dst-progress-bar {
    background-color: #f0f0f0;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.dst-progress-bar-inner {
    height: 100%;
    background-color: #0073aa;
    transition: width 0.3s;
}

.dst-upload-status {
    font-size: 0.85em;
    color: #777;
    margin-top: 5px;
}

/* Button Styles */
.dst-submit-btn {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s;
}

.dst-submit-btn:hover {
    background-color: #005f8f;
}

/* Table Styles */
.dst-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.dst-ticket-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.dst-ticket-table th, 
.dst-ticket-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.dst-ticket-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.dst-ticket-table tr:hover {
    background-color: #f9f9f9;
}

.dst-actions {
    white-space: nowrap;
}

.dst-view-ticket,
.dst-close-ticket {
    display: inline-block;
    margin: 0 3px;
    padding: 5px 10px;
    font-size: 0.9em;
    background: #f7f7f7;
    border: 1px solid #ccc;
    border-radius: 3px;
    color: #555;
    text-decoration: none;
    cursor: pointer;
}

.dst-view-ticket:hover {
    background: #f0f0f0;
}

.dst-close-ticket {
    background: #f5f5f5;
    color: #c33;
}

.dst-close-ticket:hover {
    background: #f0f0f0;
}

/* Status Styles */
.dst-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 500;
}

.dst-status-opened {
    background-color: #e7f3fd;
    color: #0073aa;
}

.dst-status-answered {
    background-color: #e6ffed;
    color: #22863a;
}

.dst-status-waiting {
    background-color: #fff5cc;
    color: #735c0f;
}

.dst-status-closed {
    background-color: #f1f1f1;
    color: #666;
}

/* Modal Styles */
.dst-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
}

.dst-modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.dst-close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.dst-close-modal:hover {
    color: #333;
}

/* Ticket Conversation */
.dst-ticket-single {
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 20px;
    border-radius: 4px;
}

.dst-ticket-meta {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.dst-meta-item {
    margin-right: 20px;
    margin-bottom: 5px;
}

.dst-ticket-conversation {
    padding: 10px 0;
}

.dst-message,
.dst-reply {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.dst-initial-message {
    border-left: 3px solid #0073aa;
}

.dst-user-reply {
    border-left: 3px solid #0073aa;
    margin-left: 20px;
}

.dst-admin-reply {
    border-left: 3px solid #46b450;
    margin-left: 20px;
    background-color: #f0f7e9;
}

.dst-message-meta {
    margin-bottom: 10px;
    font-size: 0.9em;
}

.dst-reply-date {
    color: #777;
    margin-left: 5px;
    font-weight: normal;
}

.dst-message-content {
    margin-bottom: 10px;
}

.dst-attachments {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.dst-attachment-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -5px;
}

.dst-attachment-item {
    width: calc(16.666% - 10px);
    margin: 5px;
    text-align: center;
}

.dst-attachment-thumb {
    display: block;
    border: 1px solid #ddd;
    padding: 3px;
    border-radius: 3px;
    margin-bottom: 5px;
}

.dst-attachment-thumb img {
    max-width: 100%;
    height: auto;
    display: block;
}

.dst-attachment-name {
    font-size: 0.8em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dst-back-link {
    margin-top: 20px;
}

.dst-back-link a {
    text-decoration: none;
    color: #0073aa;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .dst-meta-item {
        width: 100%;
        margin-right: 0;
    }
    
    .dst-attachment-item {
        width: calc(33.333% - 10px);
    }
    
    .dst-attachment-preview {
        width: calc(33.333% - 10px);
    }
    
    .dst-modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

/* Messages */
.dst-no-tickets {
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

/* Form validation */
.dst-form input.error,
.dst-form select.error,
.dst-form textarea.error {
    border-color: #d63638;
}

.dst-form-error-message {
    color: #d63638;
    font-size: 0.85em;
    margin-top: 5px;
}

.dst-form-success-message {
    color: #46b450;
    padding: 10px;
    background-color: #ecf7ed;
    border-left: 4px solid #46b450;
    margin-bottom: 15px;
}

/* Container */
.dst-container {
    max-width: 100%;
    margin-bottom: 30px;
    padding: 0px;
    background: #ffffff;
    border-radius: 5px;
}

/* Form Styling - Enhanced */
.dst-form {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    padding: 25px;
    border-radius: 4px;
    margin-top: 15px;
}

.dst-form-row {
    margin-bottom: 20px;
    position: relative;
}

.dst-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.dst-form-row input[type="text"],
.dst-form-row select,
.dst-form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.15s ease-in-out;
}

.dst-form-row select {
    height: 42px;
    cursor: pointer;
    background: #fff url('data:image/svg+xml;charset=US-ASCII,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M5 6l5 5 5-5 2 1-7 7-7-7z" fill="%23555"/></svg>') no-repeat right 10px top 55%;
    background-size: 16px 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 30px;
}

.dst-form-row textarea {
    min-height: 150px;
    resize: vertical;
}

.dst-form-row input[type="text"]:focus,
.dst-form-row select:focus,
.dst-form-row textarea:focus {
    border-color: #bbb;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 5px rgba(0, 113, 161, 0.2);
}

/* File Upload Area - Enhanced */
.dst-file-upload-area {
    border: 2px dashed #ddd;
    padding: 25px;
    text-align: center;
    border-radius: 4px;
    margin-bottom: 15px;
    background: #fcfcfc;
    transition: border-color 0.2s;
}

.dst-file-upload-area:hover {
    border-color: #bbb;
}

.dst-upload-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #f7f7f7;
    color: #333;
    font-weight: 500;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.dst-upload-btn:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.dst-upload-help {
    color: #777;
    font-size: 0.9em;
    margin-top: 8px;
}

/* Button Styles - Enhanced */
.dst-submit-btn {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s;
    display: inline-block;
    text-align: center;
}

.dst-submit-btn:hover {
    background-color: #005f8f;
}