/**
 * SAM Tickets - Public Styles
 * دعم RTL للغة العربية
 */

/* Form Wrapper */
.sam-ticket-form-wrapper,
.sam-my-tickets-wrapper,
.sam-ticket-status-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sam-ticket-form-wrapper h3,
.sam-my-tickets-wrapper h3,
.sam-ticket-status-wrapper h3 {
    margin-top: 0;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
    color: #333;
    font-size: 1.5em;
}

/* Form Styles */
.sam-form {
    direction: rtl;
}

.sam-form-row {
    margin-bottom: 20px;
}

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

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

.sam-form-field label .required {
    color: #e74c3c;
}

.sam-form-field input[type="text"],
.sam-form-field select,
.sam-form-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    direction: rtl;
}

.sam-form-field input:focus,
.sam-form-field select:focus,
.sam-form-field textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.sam-form-field textarea {
    resize: vertical;
    min-height: 120px;
}

/* Buttons */
.sam-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.sam-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.sam-btn:hover {
    transform: translateY(-1px);
}

.sam-btn-primary {
    background-color: #3498db;
    color: #fff;
}

.sam-btn-primary:hover {
    background-color: #2980b9;
}

.sam-btn-secondary {
    background-color: #95a5a6;
    color: #fff;
}

.sam-btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Form Messages */
.sam-form-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 5px;
}

.sam-form-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.sam-form-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Tickets Table */
.sam-tickets-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.sam-tickets-table th,
.sam-tickets-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.sam-tickets-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.sam-tickets-table tr:hover {
    background-color: #f8f9fa;
}

.sam-tickets-table a {
    color: #3498db;
    text-decoration: none;
}

.sam-tickets-table a:hover {
    text-decoration: underline;
}

/* Status & Priority Badges */
.sam-status-badge,
.sam-priority-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
}

/* Ticket Status Details */
.sam-ticket-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.sam-detail-item {
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.sam-detail-item strong {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
}

.sam-ticket-description {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.sam-ticket-description strong {
    display: block;
    margin-bottom: 10px;
    color: #333;
}

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

/* Messages */
.sam-login-required,
.sam-no-permission,
.sam-no-tickets,
.sam-error {
    padding: 20px;
    border-radius: 5px;
    text-align: center;
}

.sam-login-required {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.sam-no-permission,
.sam-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.sam-no-tickets {
    background: #e2e3e5;
    border: 1px solid #d6d8db;
    color: #383d41;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .sam-ticket-form-wrapper,
    .sam-my-tickets-wrapper,
    .sam-ticket-status-wrapper {
        padding: 20px;
        margin: 0 10px;
    }

    .sam-form-row-2 {
        grid-template-columns: 1fr;
    }

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

    .sam-tickets-table {
        display: block;
        overflow-x: auto;
    }

    .sam-form-actions {
        flex-direction: column;
    }

    .sam-btn {
        width: 100%;
    }
}

/* Loading State */
.sam-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.sam-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: sam-spin 1s linear infinite;
}

@keyframes sam-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
