/* 發起回報頁面專用樣式 */

/* 頂部導航區 */
.create-report-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 480px;
    margin: 0 auto;
}

.back-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

.back-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
    margin: 0;
    flex: 1;
    text-align: center;
}

.submit-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--white);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    flex-shrink: 0;
}

.submit-btn:hover {
    background: var(--white);
    color: var(--primary-color);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

/* 主要內容 */
.create-report-main {
    padding: 20px;
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 40px;
    background: var(--background-primary);
    min-height: calc(100vh - 70px);
}

.report-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 表單群組 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.required-mark {
    color: #ff4757;
    font-weight: 700;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    border: 2px solid var(--background-secondary);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--white);
    transition: all 0.3s;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #ff4757;
}

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

/* 字數統計 */
.char-count {
    align-self: flex-end;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.char-count.warning {
    color: #ff9f43;
}

.char-count.error {
    color: #ff4757;
}

/* 表單幫助文字 */
.form-help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: -4px;
}

/* 照片上傳區域 */
.photo-upload-area {
    border: 2px dashed var(--background-secondary);
    border-radius: var(--border-radius);
    transition: all 0.3s;
    overflow: hidden;
    background: var(--white);
}

.photo-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(52, 152, 219, 0.05);
}

.upload-placeholder {
    text-align: center;
    padding: 40px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.upload-placeholder:hover {
    background: var(--background-secondary);
}

.upload-icon {
    margin: 0 auto 16px auto;
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
}

.upload-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* 照片預覽容器 */
.photo-preview-container {
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.photo-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 2px solid var(--background-secondary);
}

.photo-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    background: #ff4757;
    border: 2px solid var(--white);
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s;
}

.photo-remove-btn:hover {
    background: #ff3742;
    transform: scale(1.1);
}

/* 聯絡資訊 */
.contact-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.info-icon {
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.info-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Toast 通知 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-color, #2ed573);
    color: var(--white);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    max-width: 90%;
    min-width: 200px;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast.error {
    background: #ff4757;
}

.toast.info {
    background: #3742fa;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-message {
    font-size: 0.9rem;
    font-weight: 500;
}

/* 確認對話框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 32px 24px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-icon {
    color: var(--primary-color);
    margin: 0 auto 16px auto;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.modal-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 24px 0;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    min-width: 80px;
}

.cancel-btn {
    background: var(--background-secondary);
    color: var(--text-secondary);
}

.cancel-btn:hover {
    background: #dee2e6;
    color: var(--text-primary);
}

.confirm-btn {
    background: var(--primary-color);
    color: var(--white);
}

.confirm-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* 錯誤訊息 */
.error-message {
    font-size: 0.85rem;
    color: #ff4757;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.error-message svg {
    width: 14px;
    height: 14px;
}

/* 載入狀態 */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 響應式設計 */
@media (max-width: 480px) {
    .header-container {
        padding: 12px 15px;
    }
    
    .create-report-main {
        padding: 15px;
    }
    
    .report-form {
        gap: 20px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 10px 14px;
    }
    
    .upload-placeholder {
        padding: 30px 15px;
    }
    
    .upload-icon {
        width: 40px;
        height: 40px;
    }
    
    .contact-info {
        padding: 16px;
        gap: 12px;
    }
    
    .modal-content {
        padding: 24px 20px;
        margin: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}

/* 無障礙設計 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高對比模式支援 */
@media (prefers-contrast: high) {
    .form-input,
    .form-select,
    .form-textarea {
        border-color: var(--text-primary);
        border-width: 2px;
    }
    
    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        border-color: var(--primary-color);
        border-width: 3px;
    }
}
