/**
 * Complaint Form Styles
 * Modern, accessible styling for the complaint submission form
 */

/* Complaint Settings Container */
.complaint-settings-container {
    padding: 0;
    max-width: 800px;
    margin: 0 auto;
}

.complaint-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.complaint-header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #1f2937;
    font-weight: 600;
}

.complaint-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* Form Styles */
.complaint-form {
    background: #ffffff;
    border-radius: 8px;
}

.form-row {
    margin-bottom: 24px;
}

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

.form-group {
    position: relative;
}

.form-group.required label::after {
    content: '';
    /* Asterisk is now shown via separate span */
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
}

.required-indicator {
    color: #dc2626;
    margin-left: 4px;
    font-weight: bold;
}

.optional-indicator {
    color: #9ca3af;
    font-weight: normal;
    font-size: 13px;
    margin-left: 4px;
}

.field-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

/* Input Fields */
.complaint-form input[type="text"],
.complaint-form input[type="date"],
.complaint-form input[type="time"],
.complaint-form select,
.complaint-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: #1f2937;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.complaint-form input[type="text"]:focus,
.complaint-form input[type="date"]:focus,
.complaint-form input[type="time"]:focus,
.complaint-form select:focus,
.complaint-form textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.complaint-form input[type="text"]:invalid:not(:placeholder-shown),
.complaint-form select:invalid:not(:placeholder-shown),
.complaint-form textarea:invalid:not(:placeholder-shown) {
    border-color: #dc2626;
}

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

/* Character Count */
.char-count {
    text-align: right;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.char-count span {
    font-weight: 500;
}

/* File Upload */
.file-upload-container {
    margin-top: 8px;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.file-upload-btn:active {
    background: #f3f4f6;
}

.file-upload-btn svg {
    color: #6b7280;
}

/* File List */
.file-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
}

.file-item svg {
    flex-shrink: 0;
    color: #6b7280;
}

.file-name {
    flex: 1;
    color: #1f2937;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: #6b7280;
    font-size: 12px;
    white-space: nowrap;
}

.remove-file-btn {
    padding: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-file-btn:hover {
    background: #ffffff;
    color: #dc2626;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #4f46e5;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.submit-btn:hover:not(:disabled) {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.submit-btn svg {
    width: 16px;
    height: 16px;
}

.cancel-btn {
    padding: 12px 24px;
    background: #ffffff;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Message Display */
.complaint-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    display: none;
}

.complaint-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.complaint-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.complaint-message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Complaint Info Section */
.complaint-info {
    margin-top: 40px;
    padding: 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.complaint-info h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #1f2937;
    font-weight: 600;
}

.complaint-info ul {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

.complaint-info li {
    margin: 8px 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .complaint-settings-container {
        padding: 0;
    }

    .form-row.two-column {
        grid-template-columns: 1fr;
        gap: 24px;
    }

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

    .submit-btn,
    .cancel-btn {
        width: 100%;
    }

    .complaint-header h3 {
        font-size: 20px;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .submit-btn,
    .cancel-btn,
    .file-upload-btn,
    .remove-file-btn,
    .complaint-form input,
    .complaint-form select,
    .complaint-form textarea {
        transition: none;
    }

    .spinner {
        animation: none;
        border-color: #ffffff;
        border-top-color: rgba(255, 255, 255, 0.5);
    }
}

/* Focus Visible for Keyboard Navigation */
.submit-btn:focus-visible,
.cancel-btn:focus-visible,
.file-upload-btn:focus-visible,
.remove-file-btn:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .file-upload-btn,
    .form-actions,
    .complaint-info {
        display: none;
    }
}

