.dynamic-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

.form-label {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.3;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 5px;
}

.form-field {
    flex: 1;
    min-width: 0;
    margin-bottom: 5px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="number"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-field .required {
    color: red;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

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

/* Checkbox styles */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.form-check-input[type=checkbox] {
    margin-top: 0px;
}

.checkbox-wrapper label {
    margin-bottom: 0;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.radio-fieldset {
    border: none;
    padding: 0;
    margin: 0;
    margin-bottom: 5px;
}

.radio-fieldset legend {
    font-weight: bold;
    margin-bottom: 0px;
    padding: 0;
    font-size: 16px;
}

.radio-group {
    display: flex;
    flex-direction: column;
}

.radio-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.radio-wrapper input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.radio-wrapper label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
}

/* Select dropdown styles */
.form-field select {
    background-color: white;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="m2 0-2 2h4zm0 5 2-2h-4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 32px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

.form-field select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-field select option {
    padding: 8px;
    background-color: white;
    color: #333;
}

.form-field select option:disabled {
    color: #999;
    background-color: #f5f5f5;
}

/* File input styles */
.file-input-wrapper {
    position: relative;
}

.file-input {
    padding: 8px;
    border: 2px dashed #ddd;
    background-color: #f8f9fa;
    cursor: pointer;
}

.file-input:hover {
    border-color: #007bff;
    background-color: #f1f8ff;
}

.file-input-info {
    font-size: 12px;
    color: #666;
    margin-top: -5px;
}

/* Custom file input styling */
.file-input::-webkit-file-upload-button {
    background-color: #007bff;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 12px;
}

.file-input::-webkit-file-upload-button:hover {
    background-color: #0056b3;
}

.error-message {
    color: red;
    font-size: 0.9em;
    margin-top: 5px;
    display: block;
}

.submit-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.submit-button:hover {
    background-color: #0056b3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-field {
        width: 100%;
    }
}

.upload-container {
    margin: 5px 0;
    position: relative;
}

.upload-container input[type="file"] {
    position: absolute !important;
    width: 0.1px !important;
    height: 0.1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    z-index: -1 !important;
    pointer-events: none !important;
}

.gumb-sekundarni {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
    text-align: center;
    transition: background-color 0.3s ease;
}

.gumb-sekundarni:hover {
    background-color: #e0e0e0;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.file-list li {
    display: flex;
    align-items: center;
    padding: 5px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
}

.file-list li span {
    flex-grow: 1;
    margin-right: 10px;
}

.remove-file {
    background: none;
    border: none;
    color: red;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 5px;
}

.remove-file:hover {
    color: darkred;
}

.double_collumn {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-texarea textarea {
    width: 100%;
    min-height: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.gumb-primarni {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

.gumb-primarni:hover {
    background-color: #0056b3;
}

.has-spinner {
    position: relative;
}

.has-spinner:after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.has-spinner.loading:after {
    display: block;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

.dynamic-form .form-row,
.dynamic-form .double_collumn {
    display: flex;
    flex-direction: row;
    gap: 40px;
    width: 100%;
    margin-bottom: 5px;
}

.dynamic-form .form-row > div,
.dynamic-form .double_collumn > div {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.dynamic-form .form-field,
.dynamic-form .form-texarea {
    width: 100%;
}

.dynamic-form .checkbox-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.dynamic-form .checkbox-row label {
    margin-left: 8px;
    font-weight: bold;
    font-size: 1.2em;
}

.upload-drop-area {
    border: 2px dashed #888;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    color: #aaa;
    margin-bottom: 5px;
    transition: border-color 0.2s, background 0.2s;
}
.upload-drop-area.dragover {
    border-color: #007bff;
}

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.upload-preview img {
    max-width: 60px;
    max-height: 60px;
    border-radius: 4px;
    border: 1px solid #ccc;
    object-fit: cover;
}

.form-row .error-message {
    flex-basis: 100%;
    width: 100%;
    margin-top: 4px;
}

/* Form dependency styles */
.form-field.dependency-hidden,
.form-row > div.dependency-hidden {
    display: none !important;
}

/* Smooth transitions for showing/hiding fields */
.form-row > div {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

/* Hidden select options */
select option[style*="display: none"] {
    display: none !important;
}

select option:disabled {
    color: #999;
    background-color: #f5f5f5;
}

/* Alternative approach for browsers that don't support hiding options */
select option.hidden {
    display: none !important;
}

/* Disabled form state styles */
.dynamic-form.disabled input,
.dynamic-form.disabled textarea,
.dynamic-form.disabled select {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.dynamic-form.disabled input:disabled,
.dynamic-form.disabled textarea:disabled,
.dynamic-form.disabled select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Submitted button styles */
.submit-button.submitted {
    background-color: #6c757d;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.7;
}

.submit-button.submitted:hover {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Success message styles */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Applications ended overlay styles */
.applications-ended-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: transparent;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    width: 100%;
    height: 100%;
}

.applications-ended-content {
    text-align: center;
}

.applications-ended-message {
    font-size: 30px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

/* Blur effect for form when applications ended */
#dynamic-generated-form.applications-ended-blur {
    position: relative;
}

#dynamic-generated-form.applications-ended-blur .form-row,
#dynamic-generated-form.applications-ended-blur .submit-button,
#dynamic-generated-form.applications-ended-blur .g-recaptcha,
#dynamic-generated-form.applications-ended-blur input[type="hidden"] {
    filter: blur(3px);
    pointer-events: none;
}

#dynamic-generated-form.applications-ended-blur .form-row::before,
#dynamic-generated-form.applications-ended-blur .submit-button::before,
#dynamic-generated-form.applications-ended-blur .g-recaptcha::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

/* Ensure overlay is not blurred */
.applications-ended-overlay {
    filter: none !important;
}

/* Label-only field styling */
.form-label-only {
    margin: 10px 0;
    padding: 8px 0;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

/* Optional: Add styling for label fields with custom classes */
.form-label-only.info {
    background-color: #e3f2fd;
    padding: 12px;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
}

.form-label-only.warning {
    background-color: #fff3e0;
    padding: 12px;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
}

.form-label-only.success {
    background-color: #e8f5e8;
    padding: 12px;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
} 
