/* VFN Public Styles */

.vfn-form-container {
    max-width: 100%;
    margin: 20px 0;
}

.vfn-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Fields Grid */
.vfn-fields-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.vfn-field {
    flex: 0 0 100%;
    margin-bottom: 20px;
}

.vfn-field-width-25 {
    flex: 0 0 calc(25% - 12px);
}

.vfn-field-width-50 {
    flex: 0 0 calc(50% - 8px);
}

.vfn-field-width-75 {
    flex: 0 0 calc(75% - 4px);
}

.vfn-field-width-100 {
    flex: 0 0 100%;
}

/* Field Label */
.vfn-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.vfn-required {
    color: #e74c3c;
    margin-left: 3px;
}

/* Input Fields */
.vfn-input,
.vfn-textarea,
.vfn-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.vfn-input:focus,
.vfn-textarea:focus,
.vfn-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.1);
}

.vfn-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Radio Group */
.vfn-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vfn-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.vfn-radio {
    margin-right: 8px;
}

/* Star Rating */
.vfn-star-rating {
    display: flex;
    gap: 5px;
    font-size: 24px;
}

.vfn-star {
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}

.vfn-star:hover,
.vfn-star.vfn-star-filled {
    color: #f39c12;
}

/* Upload Field - Modern Drag & Drop Design */
/* Force override theme colors for upload buttons */
.vfn-form-container .vfn-upload-field button.vfn-browse-btn,
.vfn-form-container .vfn-browse-btn,
.vfn-upload-field button.vfn-browse-btn,
.vfn-upload-field .vfn-browse-btn {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid #9ca3af !important;
    border-color: #9ca3af !important;
    color: #6b7280 !important;
}

.vfn-form-container .vfn-upload-field button.vfn-file-remove,
.vfn-form-container .vfn-file-remove,
.vfn-upload-field button.vfn-file-remove,
.vfn-upload-field .vfn-file-remove,
.vfn-file-preview button.vfn-file-remove {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    color: #9ca3af !important;
}

.vfn-upload-field {
    position: relative;
    width: 100%;
}

.vfn-file-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Dropzone Area */
.vfn-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #fafbfc;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.vfn-dropzone:hover {
    border-color: #9ca3af;
    background: #f3f4f6;
}

.vfn-dropzone.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: scale(1.02);
}

.vfn-dropzone.has-file {
    display: none;
}

.vfn-dropzone-content {
    pointer-events: none;
}

.vfn-upload-icon {
    margin: 0 auto 15px;
    width: 40px;
    height: 40px;
}

.vfn-upload-icon svg {
    width: 100%;
    height: 100%;
    color: #9ca3af;
}

.vfn-upload-text {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 8px 0;
}

.vfn-upload-formats {
    font-size: 13px;
    color: #9ca3af;
    margin: 0 0 20px 0;
}

.vfn-browse-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #ffffff !important;
    border: 1px solid #9ca3af !important;
    border-radius: 6px;
    color: #6b7280 !important;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    pointer-events: all;
    outline: none !important;
    text-decoration: none !important;
}

.vfn-browse-btn:hover,
.vfn-browse-btn:focus,
.vfn-browse-btn:active {
    background: #f9fafb !important;
    border-color: #6b7280 !important;
    color: #4b5563 !important;
    outline: none !important;
    text-decoration: none !important;
}

/* File Preview */
.vfn-file-preview {
    margin-top: 15px;
}

.vfn-file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    position: relative;
}

.vfn-file-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: #fef2f2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.vfn-file-icon.pdf {
    background: #fef2f2;
}

.vfn-file-icon.image {
    background: #f0fdf4;
}

.vfn-file-icon.video {
    background: #fef3c7;
}

.vfn-file-icon.document {
    background: #eff6ff;
}

.vfn-file-extension {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #dc2626;
}

.vfn-file-icon.pdf .vfn-file-extension {
    color: #dc2626;
}

.vfn-file-icon.image .vfn-file-extension {
    color: #16a34a;
}

.vfn-file-icon.video .vfn-file-extension {
    color: #d97706;
}

.vfn-file-icon.document .vfn-file-extension {
    color: #2563eb;
}

.vfn-file-details {
    flex: 1;
    min-width: 0;
}

.vfn-file-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vfn-file-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vfn-file-size {
    font-size: 12px;
    color: #9ca3af;
}

.vfn-upload-status {
    flex: 1;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    max-width: 200px;
}

.vfn-upload-progress {
    position: relative;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}

.vfn-upload-progress .vfn-progress-bar {
    display: block;
    height: 100%;
    background: #3b82f6;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.vfn-upload-progress .vfn-progress-bar.complete {
    background: #10b981;
}

/* Upload status text (no background) */
.vfn-upload-status {
    display: inline-block;
    margin-top: 4px;
    background: none !important;
}

.vfn-file-remove,
.vfn-remove-file {
    width: 20px;
    height: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #9ca3af !important;
    cursor: pointer;
    transition: color 0.2s;
    margin-left: 12px;
    padding: 0;
    outline: none !important;
}

.vfn-file-remove:hover,
.vfn-file-remove:focus,
.vfn-file-remove:active,
.vfn-remove-file:hover,
.vfn-remove-file:focus,
.vfn-remove-file:active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #6b7280 !important;
    outline: none !important;
}

.vfn-file-remove svg {
    width: 18px;
    height: 18px;
    stroke: currentColor !important;
    fill: none !important;
}

/* Error state */
.vfn-upload-field.has-error .vfn-dropzone {
    border-color: #dc2626;
}

.vfn-upload-field.has-error .vfn-file-item {
    border-color: #dc2626;
}

/* Multi-Step Forms */
.vfn-steps-progress {
    margin-bottom: 30px;
}

/* Step Title */
.vfn-step-title {
    color: #095CA7;
    text-align: center;
    margin: 20px 0 30px 0;
    font-size: 24px;
    font-weight: 600;
}

.vfn-form-navigation .vfn-progress-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.vfn-progress-fill {
    height: 100%;
    background: #3498db;
    transition: width 0.3s ease;
}

.vfn-steps-indicator {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.vfn-step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    position: relative;
    z-index: 1;
    transition: all 0.3s;
}

.vfn-step-number.active {
    background: #3498db;
    color: #fff;
}

.vfn-step-number.completed {
    background: #27ae60;
    color: #fff;
}

/* Form Navigation */
.vfn-form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.vfn-prev-step,
.vfn-next-step,
.vfn-submit {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.vfn-prev-step {
    background: #95a5a6;
    color: #fff;
}

.vfn-prev-step:hover {
    background: #7f8c8d;
}

.vfn-next-step,
.vfn-submit {
    background: #3498db;
    color: #fff;
}

.vfn-next-step:hover,
.vfn-submit:hover {
    background: #2980b9;
}

.vfn-submit:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Form Submit */
.vfn-form-submit {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Messages */
.vfn-form-messages {
    margin-top: 20px;
}

.vfn-success-message,
.vfn-error-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.vfn-success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.vfn-error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.vfn-field-error {
    display: block;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
}

/* Success Shortcode Container */
.vfn-shortcode-success {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading */
.vfn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #666;
}

.vfn-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: vfn-spin 0.8s linear infinite;
    margin-right: 10px;
}

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

/* Info Field Content */
.vfn-field-info .vfn-field-info-content {
    line-height: 1.6;
    color: inherit;
}

.vfn-field-info-content h1,
.vfn-field-info-content h2,
.vfn-field-info-content h3,
.vfn-field-info-content h4,
.vfn-field-info-content h5,
.vfn-field-info-content h6 {
    margin: 1em 0 0.5em 0;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

.vfn-field-info-content h1 { font-size: 2em; }
.vfn-field-info-content h2 { font-size: 1.5em; }
.vfn-field-info-content h3 { font-size: 1.3em; }
.vfn-field-info-content h4 { font-size: 1.1em; }
.vfn-field-info-content h5 { font-size: 1em; }
.vfn-field-info-content h6 { font-size: 0.9em; }

.vfn-field-info-content p {
    margin: 0.5em 0;
}

.vfn-field-info-content ul,
.vfn-field-info-content ol {
    margin: 0.5em 0;
    padding-left: 2em;
}

.vfn-field-info-content ul li {
    list-style-type: disc;
}

.vfn-field-info-content ol li {
    list-style-type: decimal;
}

.vfn-field-info-content a {
    color: #3498db;
    text-decoration: underline;
}

.vfn-field-info-content a:hover {
    color: #2980b9;
}

.vfn-field-info-content strong {
    font-weight: 600;
}

.vfn-field-info-content em {
    font-style: italic;
}

.vfn-field-info-content u {
    text-decoration: underline;
}

.vfn-field-info-content blockquote {
    margin: 1em 0;
    padding: 0.5em 1em;
    border-left: 3px solid #3498db;
    background: #f5f5f5;
}

.vfn-field-info-content hr {
    margin: 1.5em 0;
    border: none;
    border-top: 1px solid #ddd;
}

.vfn-field-info-content img {
    max-width: 100%;
    height: auto;
}

.vfn-field-info-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.vfn-field-info-content table th,
.vfn-field-info-content table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.vfn-field-info-content table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* Field Validation States */
.vfn-field.has-error .vfn-input,
.vfn-field.has-error .vfn-textarea,
.vfn-field.has-error .vfn-select {
    border-color: #e74c3c;
}

.vfn-field.has-success .vfn-input,
.vfn-field.has-success .vfn-textarea,
.vfn-field.has-success .vfn-select {
    border-color: #27ae60;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .vfn-field-width-25,
    .vfn-field-width-50,
    .vfn-field-width-75 {
        flex: 0 0 100%;
    }
    
    .vfn-form {
        padding: 15px;
    }
    
    .vfn-steps-indicator {
        justify-content: center;
        gap: 10px;
    }
    
    .vfn-form-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .vfn-prev-step,
    .vfn-next-step,
    .vfn-submit {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .vfn-star-rating {
        font-size: 20px;
    }
    
    .vfn-file-label {
        flex-direction: column;
        text-align: center;
    }
    
    .vfn-file-text {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Multiple file uploads */
.vfn-upload-field[data-max-files] .vfn-file-preview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.vfn-file-preview .vfn-file-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
}

.vfn-file-preview .vfn-file-item:last-child {
    margin-bottom: 0;
}

.vfn-file-preview .vfn-file-item .vfn-file-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.vfn-file-preview .vfn-file-item .vfn-file-details {
    flex: 1;
    min-width: 0;
}

.vfn-file-preview .vfn-file-item .vfn-file-name {
    font-size: 14px;
    color: #111827;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vfn-file-preview .vfn-file-item .vfn-file-size {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.vfn-file-preview .vfn-file-item .vfn-upload-progress {
    margin-top: 6px;
}

.vfn-file-preview .vfn-file-item .vfn-file-remove {
    flex-shrink: 0;
}

/* Thumbnail for saved images */
.vfn-file-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vfn-file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vfn-saved-file .vfn-file-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: #f3f4f6;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ========================================
   VFN Files Styles
   ======================================== */

/* Container Principal */
.vfn-all-files-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 20px 0;
}

/* Campo de Pesquisa */
.vfn-files-search {
    margin-bottom: 20px;
}

.vfn-all-files-container .vfn-search-input {
    width: 100% !important;
    padding: 10px 15px !important;
    border: 1px solid #dddddd !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    background: #fff !important;
    outline: none !important;
    box-shadow: none !important;
}

.vfn-all-files-container .vfn-search-input:hover {
    border-color: #095ca7 !important;
    box-shadow: 0 0 0 1px rgba(9, 92, 167, 0.2) !important;
}

.vfn-all-files-container .vfn-search-input:focus {
    outline: none !important;
    border-color: #095ca7 !important;
    box-shadow: 0 0 0 3px rgba(9, 92, 167, 0.15) !important;
}

.vfn-search-input::placeholder {
    color: #999;
}

/* Lista de Arquivos */
.vfn-files-list-simple {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Linha de Arquivo */
.vfn-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.vfn-file-row:hover {
    background: #fafafa;
}

.vfn-file-row:last-child {
    border-bottom: none;
}

/* Lado Esquerdo (Ícone + Info) */
.vfn-file-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.vfn-file-left .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #095ca7;
    flex-shrink: 0;
}

.vfn-file-info-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.vfn-file-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.vfn-file-ext {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* Lado Direito (Botão) */
.vfn-file-right {
    flex-shrink: 0;
}

.vfn-all-files-container .vfn-download-button {
    display: inline-block !important;
    padding: 8px 20px !important;
    background: #095ca7 !important;
    background-color: #095ca7 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: background 0.3s ease !important;
    border: none !important;
}

.vfn-all-files-container .vfn-download-button:hover,
.vfn-all-files-container .vfn-download-button:focus,
.vfn-all-files-container .vfn-download-button:active,
.vfn-all-files-container .vfn-download-button:visited,
.vfn-all-files-container a.vfn-download-button:hover,
.vfn-all-files-container a.vfn-download-button:focus,
.vfn-all-files-container a.vfn-download-button:active,
.vfn-all-files-container a.vfn-download-button:visited {
    background: #000000 !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    outline: none !important;
}

/* Mensagem sem resultados */
.vfn-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.vfn-no-results p {
    margin: 0;
    font-size: 14px;
}

/* Multiple Files List */
.vfn-files-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.vfn-files-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.vfn-file-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.vfn-file-icon {
    display: none;
}

.vfn-file-meta {
    flex: 1;
}

.vfn-files-list .vfn-file-item {
    flex-direction: column;
    align-items: flex-start;
}

.vfn-files-list .vfn-file-title {
    font-size: 16px;
    margin: 0 0 5px 0;
}

.vfn-files-list .vfn-file-description {
    margin: 0 0 8px 0;
}

.vfn-file-details {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}

.vfn-file-type {
    display: inline-block;
    padding: 3px 8px;
    background: #095ca7;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
}

.vfn-files-list .vfn-file-size {
    font-size: 13px;
}

.vfn-files-list .vfn-file-actions {
    width: 100%;
}

.vfn-files-list .vfn-download-btn {
    width: 100%;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vfn-all-files-container {
        padding: 15px;
    }

    .vfn-file-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }

    .vfn-file-left {
        width: 100%;
    }

    .vfn-file-right {
        width: 100%;
    }

    .vfn-download-button {
        width: 100%;
        text-align: center;
        padding: 10px 20px;
    }

    .vfn-file-name {
        font-size: 14px;
    }

    .vfn-files-layout-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .vfn-search-input {
        font-size: 13px;
        padding: 10px 12px;
    }

    .vfn-file-name {
        font-size: 13px;
    }

    .vfn-file-ext {
        font-size: 10px;
        padding: 2px 6px;
    }

    .vfn-download-button {
        font-size: 12px;
    }
}

