/* Frontend Helpdesk Styles */

/* Container */
.helpdesk-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Unread Alert */
.unread-alert {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.unread-alert i {
    color: #856404;
    font-size: 1.25rem;
}

.unread-alert span {
    color: #856404;
}

.unread-alert a {
    color: #0066cc;
    font-weight: 500;
}

/* Ticket Header Card */
.ticket-view .ticket-header {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.ticket-view .tracking-badge {
    display: inline-block;
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.ticket-view .ticket-header h1 {
    margin: 0 0 1rem 0;
    font-size: 1.4rem;
    color: #212529;
    line-height: 1.4;
}

.ticket-view .ticket-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.ticket-view .status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
}

.ticket-view .ticket-meta .date {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Alert Messages */
.helpdesk-container .alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.helpdesk-container .alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.helpdesk-container .alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Message List */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Message Card */
.message-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border: 1px solid #e9ecef;
    transition: box-shadow 0.2s;
    scroll-margin-top: 100px; /* Offset for sticky navigation */
}

.message-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Customer Message */
.message-customer {
    border-left: 4px solid #17a2b8;
    background: linear-gradient(135deg, #fff 0%, #f8fafb 100%);
}

/* Staff Message */
.message-staff {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, #fff 0%, #f6fff7 100%);
}

/* System Message */
.message-system {
    border-left: 4px solid #6c757d;
    background: #f8f9fa;
}

/* Message Header */
.message-card .message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.message-card .author {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-customer .author {
    color: #0c5460;
}

.message-staff .author {
    color: #155724;
}

.message-card .author i {
    font-size: 1rem;
}

.message-card .date {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Message Content */
.message-content {
    color: #333;
    line-height: 1.7;
    font-size: 0.95rem;
    white-space: pre-line;
}

.message-content p {
    margin: 0 0 0.75rem 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Attachments */
.message-attachments {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #dee2e6;
}

.message-attachments h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.message-attachments ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.message-attachments li a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #0066cc;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.message-attachments li a:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.message-attachments .file-size {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Reply Section */
.reply-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.reply-section h2 {
    margin: 0 0 1.25rem 0;
    font-size: 1.15rem;
    color: #333;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #0066cc;
}

.reply-section .form-group {
    margin-bottom: 1.25rem;
}

.reply-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.reply-section .required {
    color: #dc3545;
}

.reply-section textarea {
    width: 95%;
    padding: 0.875rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 150px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.reply-section textarea:focus {
    border-color: #0066cc;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.15);
}

.reply-section input[type="file"] {
    display: block;
    width: 97%;
    padding: 0.5rem;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
}

.reply-section small {
    display: block;
    margin-top: 0.35rem;
    color: #6c757d;
    font-size: 0.8rem;
}

.reply-section .error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.reply-section .form-actions {
    margin-top: 1.5rem;
}

/* Buttons */
.helpdesk-container .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.helpdesk-container .btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    color: #fff;
}

.helpdesk-container .btn-primary:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,102,204,0.3);
}

/* Closed Notice */
.closed-notice {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.closed-notice i {
    font-size: 2.5rem;
    color: #6c757d;
    margin-bottom: 1rem;
    display: block;
}

.closed-notice p {
    margin: 0 0 0.5rem 0;
    color: #495057;
}

.closed-notice .btn {
    margin-top: 1rem;
}

/* Back Link */
.back-link {
    text-align: center;
    padding: 1rem 0;
}

.back-link a {
    color: #0066cc;
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Index Page */
.helpdesk-container h1 {
    color: #212529;
    margin-bottom: 0.5rem;
}

.helpdesk-container > p {
    color: #6c757d;
    margin-bottom: 2rem;
}

/* Helpdesk Options */
.helpdesk-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.helpdesk-option {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.helpdesk-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.helpdesk-option i {
    font-size: 3rem;
    color: #0066cc;
    margin-bottom: 1rem;
    display: block;
}

.helpdesk-option h2 {
    font-size: 1.25rem;
    color: #212529;
    margin: 0 0 0.75rem 0;
}

.helpdesk-option p {
    color: #6c757d;
    margin: 0 0 1.25rem 0;
    font-size: 0.95rem;
}

/* Lookup Form */
.lookup-form {
    text-align: left;
    margin-top: 1rem;
}

.lookup-form .form-group {
    margin-bottom: 0.75rem;
}

.lookup-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 0.95rem;
}

.lookup-form input:focus {
    border-color: #0066cc;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.15);
}

/* Secondary Button */
.helpdesk-container .btn-secondary {
    background: #6c757d;
    color: #fff;
}

.helpdesk-container .btn-secondary:hover {
    background: #5a6268;
}

/* Categories Grid */
.helpdesk-categories {
    margin-top: 2.5rem;
}

.helpdesk-categories h2 {
    font-size: 1.2rem;
    color: #212529;
    margin-bottom: 1rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.category-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border: 1px solid #e9ecef;
    text-align: center;
    transition: all 0.2s;
}

.category-card:hover {
    border-color: #0066cc;
    box-shadow: 0 4px 12px rgba(0,102,204,0.15);
}

.category-card i {
    font-size: 2rem;
    color: #0066cc;
    margin-bottom: 0.75rem;
    display: block;
}

.category-card h3 {
    font-size: 1rem;
    color: #212529;
    margin: 0 0 0.5rem 0;
}

.category-card p {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0 0 0.75rem 0;
}

.category-card .btn-small {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

/* New Ticket Form */
.ticket-form {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.ticket-form .form-group {
    margin-bottom: 1.25rem;
}

.ticket-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.ticket-form .required {
    color: #dc3545;
}

.ticket-form input[type="text"],
.ticket-form input[type="email"],
.ticket-form input[type="tel"],
.ticket-form select,
.ticket-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ticket-form input:focus,
.ticket-form select:focus,
.ticket-form textarea:focus {
    border-color: #0066cc;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.15);
}

.ticket-form textarea {
    resize: vertical;
    min-height: 150px;
}

.ticket-form input[type="file"] {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
}

.ticket-form small {
    display: block;
    margin-top: 0.35rem;
    color: #6c757d;
    font-size: 0.8rem;
}

.ticket-form .error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

/* Checkbox Group */
.checkbox-group {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.checkbox-label span {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.5;
}

.checkbox-label a {
    color: #0066cc;
}

/* reCAPTCHA */
.g-recaptcha {
    margin: 1.5rem 0;
}

/* Success Page */
.success-container {
    text-align: center;
    padding: 2rem 1rem;
}

.success-icon {
    font-size: 5rem;
    color: #28a745;
    margin-bottom: 1.5rem;
}

.success-container h1 {
    color: #28a745;
    margin-bottom: 1rem;
}

.ticket-info {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 400px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.ticket-info h2 {
    font-size: 1rem;
    color: #6c757d;
    margin: 0 0 0.75rem 0;
    font-weight: normal;
}

.tracking-number {
    font-family: 'Courier New', monospace;
    font-size: 1.75rem;
    font-weight: bold;
    color: #0066cc;
    background: #e8f4fd;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.ticket-info p {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
}

.next-steps {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 2rem auto;
    max-width: 500px;
    text-align: left;
}

.next-steps h3 {
    font-size: 1rem;
    color: #333;
    margin: 0 0 1rem 0;
}

.next-steps ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.next-steps li {
    padding: 0.5rem 0 0.5rem 1.75rem;
    position: relative;
    color: #495057;
    font-size: 0.95rem;
}

.next-steps li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.success-container .actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

/* Error Page */
.error-container {
    text-align: center;
    padding: 3rem 1rem;
}

.error-icon {
    font-size: 5rem;
    color: #dc3545;
    margin-bottom: 1.5rem;
}

.error-container h1 {
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    color: #721c24;
    max-width: 500px;
    margin: 1.5rem auto;
}

.error-container .actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

/* Form Actions */
.ticket-form .form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

/* Responsive */
@media (max-width: 768px) {
    .helpdesk-container {
        padding: 1rem;
    }
    
    .ticket-view .ticket-header {
        padding: 1rem;
    }
    
    .ticket-view .ticket-header h1 {
        font-size: 1.2rem;
    }
    
    .message-card {
        padding: 1rem;
    }
    
    .reply-section {
        padding: 1rem;
    }
    
    .helpdesk-options {
        grid-template-columns: 1fr;
    }
    
    .helpdesk-option {
        padding: 1.5rem;
    }
    
    .ticket-form {
        padding: 1.25rem;
    }
    
    .ticket-form .form-actions {
        flex-direction: column;
    }
    
    .ticket-form .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
