/* Support Ticket Modal - Orders Page */

.st-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}
.st-modal-overlay.active {
    display: flex;
}

.st-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 40px;
    position: relative;
}

.st-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}
.st-modal-close:hover {
    color: #333;
}

.st-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.st-modal-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0 0 24px;
}

.st-modal-order-ref {
    font-weight: 600;
    color: #0CCAAE;
}

.st-modal-field {
    display: flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #fff;
}
.st-modal-field.st-modal-field-textarea {
    align-items: flex-start;
}

/* Inline field errors */
.st-modal-field-error {
    display: none;
    color: #dc3545;
    font-size: 13px;
    margin: -10px 0 14px 4px;
    line-height: 1.3;
}
.st-modal-field-error.is-visible {
    display: block;
}
.st-modal-field.has-error {
    border-color: #dc3545 !important;
}

.st-modal-field label {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    min-width: 100px;
    margin: 0;
    padding-right: 12px;
    border-right: 1px solid #e5e5e5;
}
.st-modal-field.st-modal-field-textarea label {
    padding-top: 4px;
}

.st-modal-field input,
.st-modal-field select,
.st-modal-field textarea {
    flex: 1;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 14px;
    color: #666 !important;
    padding: 0 0 0 12px !important;
    margin: 0 !important;
    height: auto !important;
    box-shadow: none !important;
}
.st-modal-field textarea {
    resize: none;
    min-height: 80px;
}
.st-modal-field select {
    cursor: pointer;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230CCAAE' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0 center !important;
    padding-right: 20px !important;
}

/* File upload field */
.st-modal-file-field {
    margin-bottom: 16px;
}
.st-modal-file-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
}
.st-modal-file-label:hover {
    border-color: #0CCAAE;
    color: #0CCAAE;
}
.st-modal-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 13px;
}
.st-modal-file-remove {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    margin-left: auto;
}

/* Footer buttons */
.st-modal-footer {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}
.st-modal-btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.st-modal-cancel {
    background: #1a1a1a;
    color: #fff;
}
.st-modal-cancel:hover {
    background: #333;
}
.st-modal-submit {
    background: #0CCAAE;
    color: #fff;
}
.st-modal-submit:hover {
    background: #0ab89e;
}
.st-modal-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}
.st-modal-submit.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: st-spin 0.8s linear infinite;
    vertical-align: middle;
}
@keyframes st-spin {
    to { transform: rotate(360deg); }
}

/* Messages */
.st-modal-message {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}
.st-modal-msg-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.st-modal-msg-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Support button in orders table */
.support-ticket-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #0CCAAE;
    color: #fff !important;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}
.support-ticket-btn:hover {
    background: #0ab89e;
    color: #fff !important;
}

/* Responsive */
@media (max-width: 768px) {
    .st-modal-content {
        padding: 24px 20px;
        margin: 10px;
    }
    .st-modal-field {
        flex-direction: column;
        align-items: flex-start;
    }
    .st-modal-field label {
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        padding-bottom: 8px;
        margin-bottom: 8px;
        width: 100%;
        min-width: auto;
    }
    .st-modal-field input,
    .st-modal-field select,
    .st-modal-field textarea {
        padding-left: 0 !important;
        width: 100%;
    }
    .st-modal-footer {
        flex-direction: column;
    }
}
