/* --- New Form Styles for Contractors Page --- */

/* Required field marker */
.form-required {
    color: #ef4444;
    font-weight: 700;
    margin-right: 2px;
}

/* Select / Dropdown styling */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8.825L.35 3.175 1.4 2.125 6 6.725 10.6 2.125l1.05 1.05z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 34px;
}

.form-select option {
    padding: 10px;
    font-family: inherit;
}

/* Add new option buttons */
.btn-add-option,
.btn-cancel-option {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.btn-add-option {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    margin-right: 10px;
}

.btn-add-option:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-cancel-option {
    background: #f1f5f9;
    color: #64748b;
    margin-right: 5px;
}

.btn-cancel-option:hover {
    background: #fecaca;
    color: #ef4444;
}

/* File Upload Area */
.form-file-upload {
    border: 2px dashed #d1d5db;
    border-radius: 14px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(248, 250, 252, 0.6);
    position: relative;
    width: 100%;
}

.form-file-upload:hover {
    border-color: var(--primary-color);
    background: rgba(29, 38, 45, 0.03);
}

.form-file-upload.drag-over {
    border-color: var(--primary-color);
    background: rgba(29, 38, 45, 0.06);
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(29, 38, 45, 0.08);
}

.form-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.file-upload-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(29, 38, 45, 0.08), rgba(29, 38, 45, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 4px;
    transition: var(--transition-fast);
}

.form-file-upload:hover .file-upload-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(29, 38, 45, 0.25);
}

.file-upload-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

.file-upload-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.file-upload-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
}

/* File Preview (single file) */
.file-upload-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(29, 38, 45, 0.05);
    padding: 12px 16px;
    border-radius: 10px;
    pointer-events: auto;
    position: relative;
    z-index: 20;
}

.file-upload-preview i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.file-upload-preview .file-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-remove-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #fef2f2;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.file-remove-btn:hover {
    background: #ef4444;
    color: #fff;
    transform: scale(1.1);
}

/* File List (multiple files) */
.file-upload-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    width: 100%;
}

.file-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(29, 38, 45, 0.05);
    padding: 10px 14px;
    border-radius: 8px;
    pointer-events: auto;
}

.file-list-item i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.file-list-item .file-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list-item .file-size {
    font-size: 0.75rem;
    color: #94a3b8;
    flex-shrink: 0;
}

/* Form Dropdown Wrapper */
.form-dropdown-wrapper {
    position: relative;
}

.form-new-option {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Force submit button to use the main font */
.form-submit {
    font-family: var(--font-main, "Noto Kufi Arabic", sans-serif);
}

@media (max-width: 900px) {
    .form-file-upload {
        padding: 22px 14px;
        border-radius: 12px;
    }

    .file-upload-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .file-upload-text {
        font-size: 0.9rem;
    }

    .file-upload-hint {
        font-size: 0.76rem;
    }

    .file-upload-preview,
    .file-list-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .file-upload-preview .file-name,
    .file-list-item .file-name {
        width: 100%;
        min-width: 0;
    }

    .file-remove-btn {
        margin-inline-start: auto;
    }
}

@media (max-width: 640px) {
    .form-file-upload {
        padding: 18px 12px;
    }
}
