/**
 * Frontend styles for Job Support Tickets
 */

/* Reset and base styles */
.jst-ticket-form-container *,
.jst-dashboard-container * {
    box-sizing: border-box;
}

/* Main container */
.jst-ticket-form-container,
.jst-dashboard-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Progress bar */
.jst-progress-container {
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.jst-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.jst-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #14a34b, #16a34a);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.jst-progress-text {
    text-align: center;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

/* Form header */
.jst-form-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.jst-form-header h2 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: #212529;
    background: linear-gradient(135deg, #14a34b, #16a34a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.jst-form-subheader {
    margin: 0;
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 400;
}

/* Form steps */
.jst-form-step {
    display: none;
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.jst-form-step.jst-step-active {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jst-step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.jst-step-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
}

.jst-step-indicator {
    background: #14a34b;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Form groups and layout */
.jst-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.jst-form-group {
    margin-bottom: 25px;
}

.jst-half-width {
    flex: 1;
}

.jst-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
}

.jst-form-group label .required {
    color: #dc3545;
    font-weight: 700;
}

/* Form inputs */
.jst-form-group input[type="text"],
.jst-form-group input[type="email"],
.jst-form-group input[type="tel"],
.jst-form-group select,
.jst-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #495057;
}

.jst-form-group input:focus,
.jst-form-group select:focus,
.jst-form-group textarea:focus {
    outline: none;
    border-color: #14a34b;
    box-shadow: 0 0 0 3px rgba(20, 163, 75, 0.1);
    background-color: #ffffff;
}

.jst-form-group input:invalid,
.jst-form-group select:invalid,
.jst-form-group textarea:invalid {
    border-color: #dc3545;
}

.jst-form-group input.error,
.jst-form-group select.error,
.jst-form-group textarea.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.jst-form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

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

/* Character count */
.jst-character-count {
    text-align: right;
    margin-top: 5px;
    font-size: 0.875rem;
    color: #6c757d;
}

.jst-character-count.warning {
    color: #f59e0b;
}

.jst-character-count.error {
    color: #dc3545;
}

/* Form navigation */
.jst-form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.jst-form-navigation .jst-btn:only-child {
    margin-left: auto;
}

/* Buttons */
.jst-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.jst-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.jst-btn-primary,
.jst-btn-next,
.jst-btn-submit {
    background: linear-gradient(135deg, #14a34b, #16a34a);
    color: white;
    box-shadow: 0 4px 15px rgba(20, 163, 75, 0.3);
}

.jst-btn-primary:hover,
.jst-btn-next:hover,
.jst-btn-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #16a34a, #15803d);
    box-shadow: 0 6px 20px rgba(20, 163, 75, 0.4);
    transform: translateY(-2px);
}

.jst-btn-secondary,
.jst-btn-prev {
    background: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.jst-btn-secondary:hover,
.jst-btn-prev:hover {
    background: #5a6268;
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    transform: translateY(-2px);
}

/* Button loading state */
.jst-btn-loading {
    display: none;
}

.jst-btn.loading .jst-btn-text {
    display: none;
}

.jst-btn.loading .jst-btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jst-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success and error messages */
.jst-success-message,
.jst-error-message {
    text-align: center;
    padding: 40px;
    border-radius: 12px;
    margin: 20px 0;
    animation: fadeIn 0.5s ease-out;
}

.jst-success-message {
    background: linear-gradient(135deg, #d1fae5, #ecfdf5);
    border: 2px solid #10b981;
    color: #065f46;
}

.jst-error-message {
    background: linear-gradient(135deg, #fef2f2, #fef2f2);
    border: 2px solid #ef4444;
    color: #991b1b;
}

.jst-success-icon,
.jst-error-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.jst-success-icon {
    color: #10b981;
}

.jst-error-icon {
    color: #ef4444;
}

.jst-success-message h3,
.jst-error-message h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.jst-ticket-info {
    background: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 1.1rem;
}

.jst-success-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Login required */
.jst-login-required {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.jst-login-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    color: #6c757d;
}

.jst-login-required h3 {
    margin: 0 0 15px 0;
    font-size: 1.8rem;
    color: #495057;
}

.jst-login-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Dashboard styles */
.jst-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.jst-dashboard-header h2 {
    margin: 0;
    font-size: 2rem;
    color: #212529;
}

.jst-no-tickets {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.jst-no-tickets-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    color: #6c757d;
}

.jst-no-tickets h3 {
    margin: 0 0 15px 0;
    font-size: 1.8rem;
    color: #495057;
}

/* Ticket cards */
.jst-tickets-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.jst-ticket-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
}

.jst-ticket-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.jst-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.jst-ticket-number {
    font-size: 1.1rem;
    color: #14a34b;
}

.jst-ticket-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.jst-status-open {
    background: #dbeafe;
    color: #1e40af;
}

.jst-status-in_progress {
    background: #fef3c7;
    color: #92400e;
}

.jst-status-pending {
    background: #e0e7ff;
    color: #3730a3;
}

.jst-status-closed {
    background: #d1fae5;
    color: #065f46;
}

.jst-ticket-subject {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.4;
}

.jst-ticket-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #6c757d;
}

.jst-ticket-description {
    color: #495057;
    line-height: 1.5;
    margin-bottom: 20px;
}

.jst-ticket-actions {
    text-align: right;
}

/* Modal styles */
.jst-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.jst-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    backdrop-filter: blur(4px);
}

.jst-modal-content {
    background: #ffffff;
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 10000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.jst-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 12px 12px 0 0;
}

.jst-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #212529;
}

.jst-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.jst-modal-close:hover {
    background: #e9ecef;
    color: #495057;
}

.jst-modal-body {
    padding: 25px;
}

/* Ticket details in modal */
.jst-ticket-details {
    line-height: 1.6;
}

.jst-ticket-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.jst-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.jst-info-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.jst-info-row strong {
    color: #495057;
    min-width: 120px;
}

.jst-ticket-subject h4 {
    margin: 0 0 15px 0;
    color: #212529;
    font-size: 1.3rem;
}

.jst-description-content {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Ticket responses */
.jst-ticket-responses {
    margin: 30px 0;
}

.jst-ticket-responses h5 {
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    color: #212529;
}

.jst-response {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.jst-admin-response {
    border-left: 4px solid #14a34b;
}

.jst-user-response {
    border-left: 4px solid #6c757d;
}

.jst-response-header {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.jst-admin-badge {
    background: #14a34b;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.jst-response-date {
    margin-left: auto;
    color: #6c757d;
}

.jst-response-content {
    padding: 20px;
    background: #ffffff;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Add response form */
.jst-add-response {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.jst-add-response h5 {
    margin: 0 0 15px 0;
    color: #212529;
}

.jst-add-response textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 15px;
    resize: vertical;
    min-height: 100px;
}

.jst-add-response textarea:focus {
    outline: none;
    border-color: #14a34b;
    box-shadow: 0 0 0 3px rgba(20, 163, 75, 0.1);
}

/* Form validation errors */
.jst-field-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
    display: block;
}

.jst-form-group.has-error input,
.jst-form-group.has-error select,
.jst-form-group.has-error textarea {
    border-color: #dc3545;
    background-color: #fff5f5;
}

/* Responsive design */
@media (max-width: 768px) {
    .jst-ticket-form-container,
    .jst-dashboard-container {
        padding: 15px;
    }
    
    .jst-form-header h2 {
        font-size: 2rem;
    }
    
    .jst-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .jst-form-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .jst-dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .jst-tickets-grid {
        grid-template-columns: 1fr;
    }
    
    .jst-ticket-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .jst-success-actions,
    .jst-login-actions {
        flex-direction: column;
    }
    
    .jst-modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .jst-info-row {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .jst-form-header {
        padding: 20px;
    }
    
    .jst-form-header h2 {
        font-size: 1.8rem;
    }
    
    .jst-form-step {
        padding: 20px;
    }
    
    .jst-step-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .jst-ticket-card {
        padding: 20px;
    }
    
    .jst-modal-header,
    .jst-modal-body {
        padding: 20px;
    }
}

/* Animation for fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
