/* Ticket System Public CSS */

/* General Styles */
.ticket-system-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Form Styles */
.ticket-form-container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

/* Buttons */
.button {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.button-primary {
    background: #2271b1;
    color: #fff;
}

.button-primary:hover {
    background: #135e96;
}

.button-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.button-secondary {
    background: #f0f0f1;
    color: #2c3338;
}

.button-secondary:hover {
    background: #dcdcde;
}

.button-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Messages */
.success-message {
    padding: 15px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error-message {
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

.info-message {
    padding: 15px;
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

/* Tables */
.tickets-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tickets-table thead {
    background: #f6f7f7;
}

.tickets-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.tickets-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

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

.tickets-table tbody tr:last-child td {
    border-bottom: none;
}

/* Ticket View */
.ticket-view-container {
    max-width: 900px;
    margin: 0 auto;
}

.ticket-details-box {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ticket-meta {
    margin-top: 15px;
}

.meta-item {
    margin-bottom: 12px;
    padding: 12px 15px;
    background: #f9f9f9;
    border-left: 3px solid #2271b1;
    border-radius: 3px;
}

.meta-item strong {
    color: #333;
    margin-right: 8px;
}

.ticket-original-message {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ticket-original-message h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
}

.message-content {
    line-height: 1.8;
    color: #555;
}

/* Messages Thread */
.ticket-messages-thread {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ticket-messages-thread h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
}

#ticket-messages-list {
    margin-bottom: 20px;
}

.ticket-message {
    padding: 15px;
    margin-bottom: 15px;
    background: #f6f7f7;
    border-left: 3px solid #2271b1;
    border-radius: 4px;
}

.message-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ddd;
}

.message-header strong {
    color: #333;
    font-size: 14px;
}

.message-date {
    float: right;
    color: #666;
    font-size: 12px;
}

.message-body {
    line-height: 1.6;
    color: #555;
}

.no-messages {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

/* Reply Form */
.ticket-reply-form {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.ticket-reply-form h4 {
    margin-top: 0;
    color: #333;
}

.form-actions {
    margin-top: 15px;
}

.form-actions .button {
    margin-right: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .ticket-system-container,
    .ticket-view-container,
    .ticket-form-container {
        padding: 15px;
    }
    
    .tickets-table {
        font-size: 14px;
    }
    
    .tickets-table th,
    .tickets-table td {
        padding: 10px;
    }
    
    .form-actions .button {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.ticket-closed-box {
	margin-top: 15px;
    display: flex;
    gap: 16px;
    padding: 20px;
    margin-bottom: 25px;
    background: #f8d7da;
    border-left: 6px solid #dc3545;
    border-radius: 8px;
}

.ticket-closed-icon {
    font-size: 32px;
    line-height: 1;
}

.ticket-closed-content h3 {
    margin: 0 0 8px;
    color: #842029;
}

.ticket-closed-content p {
    margin: 4px 0;
    color: #5c1c24;
}

.ticket-closed-note {
    margin-top: 10px;
    font-size: 14px;
    font-style: italic;
}
