/**
 * Front-end Styles for Samaneh Tickets.
 */

/* Form Wrapper */
.samaneh-ticket-form-wrapper {
    max-width: 800px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.samaneh-ticket-form-wrapper h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Notices */
.samaneh-ticket-notice,
.samaneh-ticket-error,
.samaneh-ticket-success {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
}

.samaneh-ticket-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.samaneh-ticket-error {
    background: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
}

.samaneh-ticket-success {
    background: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
}

/* Form Styles */
.samaneh-ticket-form .form-group {
    margin-bottom: 20px;
}

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

.samaneh-ticket-form .required {
    color: #dc3545;
}

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

.samaneh-ticket-form .form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.samaneh-ticket-form textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.samaneh-ticket-form .button.button-primary {
    background: #0073aa;
    border: none;
    color: #fff;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.samaneh-ticket-form .button.button-primary:hover {
    background: #005177;
}

/* Tabs Section */
.samaneh-ticket-tabs {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.samaneh-ticket-tabs h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

/* Ticket History Table */
.samaneh-ticket-history,
.samaneh-ticket-history-compact {
    margin-top: 20px;
}

.samaneh-ticket-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.samaneh-ticket-table thead {
    background: #f8f9fa;
}

.samaneh-ticket-table th,
.samaneh-ticket-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.samaneh-ticket-table th {
    font-weight: 600;
    color: #333;
}

.samaneh-ticket-table tbody tr:hover {
    background: #f8f9fa;
}

.samaneh-ticket-table .ticket-title {
    font-weight: 500;
    color: #333;
}

/* Status Badges */
.samaneh-ticket-table .ticket-status span {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.samaneh-ticket-table .status-samaneh-open {
    background: #28a745;
}

.samaneh-ticket-table .status-samaneh-in-progress {
    background: #ffc107;
    color: #333;
}

.samaneh-ticket-table .status-samaneh-closed {
    background: #6c757d;
}

.samaneh-ticket-table .ticket-date {
    color: #666;
    font-size: 14px;
}

.samaneh-ticket-table .ticket-actions {
    white-space: nowrap;
}

.samaneh-ticket-table .button.button-small {
    padding: 6px 12px;
    font-size: 13px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
}

.samaneh-ticket-table .button.button-small:hover {
    background: #005177;
}

/* No Tickets Message */
.samaneh-no-tickets {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
}

/* Modal Styles */
.samaneh-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
}

.samaneh-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.samaneh-modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

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

/* Ticket Detail in Modal */
.samaneh-ticket-detail h3 {
    margin-top: 0;
    color: #333;
    padding-right: 30px;
}

.samaneh-ticket-detail .ticket-meta {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.samaneh-ticket-detail .ticket-meta p {
    margin: 8px 0;
    color: #555;
}

.samaneh-ticket-detail .ticket-meta strong {
    color: #333;
}

.samaneh-ticket-detail .ticket-description {
    line-height: 1.6;
    color: #444;
}

.samaneh-ticket-detail .ticket-description h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

/* Ticket Replies / Chat Thread in Modal */
.samaneh-ticket-detail .ticket-replies {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.samaneh-ticket-detail .ticket-replies h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.samaneh-ticket-detail .no-replies {
    color: #666;
    font-style: italic;
    padding: 15px 0;
}

.samaneh-ticket-detail .replies-list {
    margin: 15px 0;
}

.samaneh-ticket-detail .reply-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 12px;
}

.samaneh-ticket-detail .reply-item.admin-reply {
    background: #e8f4fd;
    border-color: #b8e3ff;
}

.samaneh-ticket-detail .reply-item.user-reply {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.samaneh-ticket-detail .reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.samaneh-ticket-detail .reply-author {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.samaneh-ticket-detail .reply-badge {
    background: #0073aa;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.samaneh-ticket-detail .reply-date {
    color: #666;
    font-size: 11px;
    margin-left: auto;
}

.samaneh-ticket-detail .reply-content {
    line-height: 1.5;
    color: #444;
    font-size: 14px;
}

.samaneh-ticket-detail .reply-content p {
    margin: 0 0 8px 0;
}

.samaneh-ticket-detail .reply-content p:last-child {
    margin-bottom: 0;
}

/* Reply Form in Modal */
.samaneh-ticket-detail .reply-form-wrapper {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.samaneh-ticket-detail .reply-form-wrapper h5 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #333;
    font-size: 16px;
}

.samaneh-ticket-detail .reply-form .form-group {
    margin-bottom: 12px;
}

.samaneh-ticket-detail .reply-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.samaneh-ticket-detail .reply-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.samaneh-ticket-detail .reply-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.samaneh-ticket-detail .reply-form .button.button-primary {
    background: #0073aa;
    border: none;
    color: #fff;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.samaneh-ticket-detail .reply-form .button.button-primary:hover {
    background: #005177;
}

/* Responsive Design */
@media (max-width: 768px) {
    .samaneh-ticket-form-wrapper {
        padding: 20px;
        margin: 20px;
    }

    .samaneh-ticket-table {
        font-size: 14px;
    }

    .samaneh-ticket-table th,
    .samaneh-ticket-table td {
        padding: 10px;
    }

    .samaneh-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}
