/* FFL Modal Styles */
.ffl-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 9998;
    display: block;
}

#ffl-required-modal.ffl-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 1.5px 6px #0073aa33;
    z-index: 9999;
    min-width: 320px;
    max-width: 90vw;
    outline: none;
    padding: 0;
    font-family: inherit;
    animation: ffl-modal-fadein 0.2s;
}

@keyframes ffl-modal-fadein {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.ffl-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #db2c04;
    color: #fff;
    padding: 10px 16px 8px 16px;
    border-radius: 6px 6px 0 0;
}
.ffl-modal-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}
.ffl-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    font-weight: normal;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    margin-left: 10px;
    border-radius: 3px;
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Remove button appearance for accessibility */
    appearance: none;
}
.ffl-modal-close svg {
    display: block;
    width: 22px;
    height: 22px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    pointer-events: none;
}
.ffl-modal-close:hover, .ffl-modal-close:focus {
    background: none;
    outline: none;
    /* No color or background change on hover/focus */
}
.ffl-modal-close svg {
    display: block;
    width: 22px;
    height: 22px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
}
.ffl-modal-close:hover, .ffl-modal-close:focus {
    background: none;
    outline: none;
}
.ffl-modal-body {
    padding: 18px 20px 20px 20px;
    font-size: 14px;
    color: #333;
    text-align: left;
}
.ffl-modal-body p {
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 480px) {
    #ffl-required-modal.ffl-modal {
        min-width: 0;
        width: 96vw;
        padding: 0;
    }
    .ffl-modal-header, .ffl-modal-body {
        padding-left: 10px;
        padding-right: 10px;
    }
}
/* FFL Document Upload Styles - Ultra Compact Design */
.ffl-document-section {
    margin: 8px 0;
    max-width: 600px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 3px;
    overflow: hidden;
}

.ffl-document-header {
    background: #f9f9f9;
    padding: 4px 8px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ffl-document-title {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.ffl-document-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.ffl-document-toggle:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.ffl-document-upload-section {
    padding: 6px 8px;
}

.ffl-document-info {
    margin-bottom: 6px;
}

.ffl-document-description {
    margin: 0 0 2px 0;
    font-size: 10px;
    color: #666;
    line-height: 1.2;
}

.ffl-document-formats {
    margin: 0;
    font-size: 8px;
    color: #666;
    font-style: italic;
}

.ffl-document-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ffl-document-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
}

/* Required document: red left border and subtle background, always visible */
.ffl-document-item.required {
    border-left: 4px solid #dc3545 !important;
    background: #fff5f5 !important;
    box-shadow: 0 0 0 1px #dc35451a;
}

.ffl-document-label {
    font-weight: 600;
    color: #333;
    font-size: 10px;
    width: 75px;
    flex-shrink: 0;
}

.ffl-document-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.ffl-upload-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 3px 6px;
    border-radius: 2px;
    font-size: 9px;
    cursor: pointer;
    transition: background 0.3s ease;
    min-width: 60px;
}

.ffl-upload-button:hover {
    background: #005a87;
}

.ffl-file-name {
    font-size: 8px;
    color: #666;
    font-style: italic;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ffl-document-progress {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.ffl-progress-container {
    flex: 1;
    height: 2px;
    background: #f1f1f1;
    border-radius: 1px;
    overflow: hidden;
}

.ffl-progress-bar {
    height: 100%;
    background: #0073aa;
    width: 0%;
    transition: width 0.3s ease;
}

.ffl-progress-text {
    font-size: 8px;
    color: #666;
    white-space: nowrap;
}

.ffl-uploaded-document {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    max-width: 100%;
    overflow: hidden;
}

.ffl-document-name {
    font-size: 9px;
    color: #333;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0; /* Allows flexbox to shrink the element */
    max-width: calc(100% - 50px); /* Reserve space for delete button */
}


/* Trash Can Icon Button - Always Consistent, Not Affected by Theme */

.ffl-delete-document {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 32px !important;
    height: 32px !important;
    background: none !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    outline: none !important;
    box-shadow: none !important;
    transition: none !important;
    min-width: 32px !important;
    min-height: 32px !important;
    flex-shrink: 0 !important;
    font-family: Arial, "Segoe UI", sans-serif !important;
    font-size: 0 !important;
    color: #dc3545 !important;
    appearance: none !important;
    line-height: 1 !important;
    cursor: hand;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    /* Remove all box and text shadows */
    text-shadow: none !important;
    filter: none !important;
    pointer-events: auto !important;
}

.ffl-delete-document svg {
    width: 15px !important;
    height: 20px !important;
    display: block !important;
    pointer-events: none !important;
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}


/* Remove all interactive states for trash can icon when not a button */
/* Show pointer cursor on hover for trash can icon */
.ffl-delete-document:hover,
.ffl-delete-document:focus,
.ffl-delete-document:active {
    cursor: pointer !important;
    background: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.ffl-delete-document svg path {
    fill: #fff !important;
    stroke: #fff !important;
    stroke-width: 1.5 !important;
    paint-order: stroke fill markers;
}

.ffl-state-required-indicator {
    color: #dc3545;
    font-weight: 500;
}

/* Hide controls when file is uploaded - cleaner layout */
.ffl-document-item .ffl-document-controls.hidden,
.ffl-document-item .ffl-document-controls[style*="display: none"] {
    display: none !important;
}

/* Ensure uploaded document takes full width when controls are hidden */
.ffl-uploaded-document {
    width: 100%;
    justify-content: space-between;
    max-width: 100%;
    overflow: hidden;
}

/* Ensure proper layout within document items */
.ffl-document-item {
    overflow: hidden; /* Prevent content from overflowing the container */
}

/* Responsive design */
@media (max-width: 600px) {
    .ffl-document-section {
        max-width: none;
        margin: 6px 0;
    }
    
    .ffl-document-item {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        min-height: auto;
        padding: 2px 4px;
    }
    
    .ffl-document-label {
        width: auto;
        margin-bottom: 1px;
    }
}
