/* KYC Forms Styling */

/* File Upload Button Improvements */

/* Override any global SVG styles that might interfere */
.file-upload-wrapper svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
}

/* Ensure file upload wrapper is properly styled */
.file-upload-wrapper {
    position: relative !important;
    display: inline-block !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
}

/* Hide the default file input completely */
.file-upload-wrapper input[type="file"] {
    position: absolute !important;
    z-index: 2 !important;
    width: 100% !important;
    height: 44px !important;
    margin: 0 !important;
    opacity: 0 !important;
    cursor: pointer !important;
    top: 0 !important;
    left: 0 !important;
    /* Hide the default text */
    font-size: 0 !important;
    color: transparent !important;
}

/* Style the custom button */
.file-upload-wrapper .file-upload-button {
    position: relative !important;
    z-index: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 44px !important;
    padding: 0 16px !important;
    background: #f8fafc !important;
    border: 2px dashed #cbd5e1 !important;
    border-radius: 8px !important;
    color: #64748b !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    gap: 8px !important;
    overflow: hidden !important;
    /* Ensure no default button styles interfere */
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    text-decoration: none !important;
    outline: none !important;
}

.file-upload-wrapper:hover .file-upload-button {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #475569 !important;
}

.file-upload-wrapper input[type="file"]:focus + .file-upload-button {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.file-upload-wrapper input[type="file"]:valid + .file-upload-button {
    background: #ecfdf5 !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
}

/* Style the file upload icon */
.file-upload-wrapper .file-upload-icon {
    flex-shrink: 0 !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    fill: none !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure the span text is properly styled */
.file-upload-wrapper .file-upload-button span {
    display: inline-block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: calc(100% - 28px) !important; /* Account for icon width + gap */
}

/* Form Section Styling */
.kyc-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
}

.kyc-section h2 {
    color: #111827;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

/* Input Field Styling */
.kyc-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.kyc-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.kyc-input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
    color: #6b7280;
}

.kyc-textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    transition: all 0.2s ease;
    background: #ffffff;
}

.kyc-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.kyc-textarea:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
    color: #6b7280;
}

/* Select Field Styling */
.kyc-select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kyc-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.kyc-select:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
    color: #6b7280;
}

/* Radio and Checkbox Styling */
.kyc-radio,
.kyc-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    accent-color: #3b82f6;
}

.kyc-radio:disabled,
.kyc-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Label Styling */
.kyc-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.kyc-label-helper {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
    font-style: italic;
}

/* Error Styling */
.kyc-error {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Submit Button Styling */
.kyc-submit-btn {
    background: #059669;
    color: #ffffff;
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kyc-submit-btn:hover {
    background: #047857;
    transform: translateY(-1px);
}

.kyc-submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.kyc-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Read-only Mode Styling */
.kyc-readonly {
    background: #f3f4f6;
    cursor: not-allowed;
    color: #6b7280;
}

.kyc-readonly-label {
    color: #6b7280;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kyc-section {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .kyc-section h2 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .kyc-input,
    .kyc-textarea,
    .kyc-select {
        height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .kyc-submit-btn {
        width: 100%;
        padding: 16px 24px;
    }
}

/* Grid Layout Improvements */
.kyc-grid {
    display: grid;
    gap: 20px;
}

.kyc-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.kyc-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.kyc-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

@media (max-width: 640px) {
    .kyc-grid-2,
    .kyc-grid-3,
    .kyc-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* File Upload Status */
.file-upload-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.file-upload-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.file-upload-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.file-upload-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* File Selection States */
.file-upload-wrapper.file-selected .file-upload-button {
    background: #ecfdf5 !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
}

.file-upload-wrapper.drag-over .file-upload-button {
    background: #eff6ff !important;
    border-color: #3b82f6 !important;
    color: #1e40af !important;
    transform: scale(1.02);
}

/* Drag and Drop Animation */
.file-upload-wrapper {
    transition: all 0.2s ease;
}

.file-upload-wrapper.drag-over {
    transform: scale(1.02);
}

/* File Upload Button Hover Effects */
.file-upload-wrapper .file-upload-button:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #475569 !important;
    transform: translateY(-1px);
}

.file-upload-wrapper.file-selected .file-upload-button:hover {
    background: #d1fae5 !important;
    border-color: #059669 !important;
    color: #064e3b !important;
}

/* Override any conflicting Tailwind or global styles */
.file-upload-wrapper * {
    box-sizing: border-box !important;
}

/* Ensure proper spacing in form grids */
.kyc-form-grid .file-upload-wrapper {
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .file-upload-wrapper .file-upload-button {
        height: 48px !important;
        font-size: 16px !important;
    }
    
    .file-upload-wrapper .file-upload-icon {
        width: 18px !important;
        height: 18px !important;
    }
}

/* Additional utility classes for file uploads */
.file-upload-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.file-upload-disabled .file-upload-button {
    cursor: not-allowed !important;
    background: #f3f4f6 !important;
    border-color: #d1d5db !important;
    color: #9ca3af !important;
}

/* File type indicators */
.file-upload-wrapper .file-type-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}
