/**
 * Complaint Form Styles - Matching Other Tabs Design
 * Modern, accessible styling consistent with Translation Languages and Password tabs
 */

/* Placeholder - transparent to layout */
#complaint-settings-placeholder {
    display: contents;
}

/* Main wrapper - matches other tabs container style */
.new-complaint-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

/* Header section - matches password settings style */
.new-complaint-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.new-complaint-header h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #495057;
    font-weight: 600;
}

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

/* Form container - styled like password-settings-container */
.new-complaint-form {
    width: 100%;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e1e5e9;
    margin-bottom: 30px;
}

/* Form rows */
.new-complaint-form .new-form-row {
    margin-bottom: 24px;
}

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

/* Form groups - styled like password settings */
.new-complaint-form .new-form-group {
    position: relative;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s ease;
}

.new-complaint-form .new-form-group:hover {
    border-color: #cbd5e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.new-complaint-form .new-form-group:focus-within {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.new-complaint-form .new-form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

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

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

.new-complaint-form .field-help {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Input fields - styled like other tabs */
.new-complaint-form input[type="text"],
.new-complaint-form input[type="date"],
.new-complaint-form input[type="time"],
.new-complaint-form select,
.new-complaint-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: #495057;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

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

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

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

/* Character count */
.new-complaint-form .char-count {
    text-align: right;
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
}

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

/* File upload - styled like other buttons */
.new-complaint-form .file-upload-container {
    margin-top: 8px;
}

.new-complaint-form .file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-complaint-form .file-upload-btn:hover {
    background: #f8f9ff;
    border-color: #4f46e5;
    color: #4f46e5;
}

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

.new-complaint-form .file-upload-btn svg {
    color: #6b7280;
    transition: color 0.2s ease;
}

.new-complaint-form .file-upload-btn:hover svg {
    color: #4f46e5;
}

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

.new-complaint-form .file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.new-complaint-form .file-item:hover {
    border-color: #cbd5e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

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

.new-complaint-form .file-size {
    color: #6c757d;
    font-size: 12px;
    white-space: nowrap;
}

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

.new-complaint-form .remove-file-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Form actions - matches settings-actions style */
.new-complaint-form .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e1e5e9;
}

.new-complaint-form .submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.new-complaint-form .submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

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

.new-complaint-form .submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.new-complaint-form .submit-btn svg {
    width: 18px;
    height: 18px;
}

.new-complaint-form .cancel-btn {
    padding: 14px 28px;
    background: white;
    color: #6c757d;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-complaint-form .cancel-btn:hover {
    background: #f8f9fa;
    border-color: #cbd5e0;
    color: #495057;
}

/* Loading spinner */
.new-complaint-form .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 - matches settings-message style */
.new-complaint-form .complaint-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    display: none;
}

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

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

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

/* Info section - matches history-info style */
.new-complaint-info {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    border-left: 4px solid #4f46e5;
}

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

.new-complaint-info ul {
    margin: 10px 0;
    padding-left: 20px;
    color: #6c757d;
}

.new-complaint-info li {
    margin: 5px 0;
    font-size: 13px;
    line-height: 1.5;
}

/* ALTCHA CAPTCHA Widget Styles */
.new-complaint-form altcha-widget {
    display: block;
    margin-top: 8px;
    width: 100%;
}

.new-complaint-form altcha-widget::part(button) {
    border-radius: 8px;
    font-size: 14px;
}

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

    .new-complaint-form {
        padding: 15px;
    }

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

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

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

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

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

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

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

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