/* Create Adoption Form Styles - Tema Arancione */

/* ===== CONTAINER PRINCIPALE ===== */
.create-form {
    max-width: 800px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.form-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 32px;
    font-size: 2rem;
    font-weight: 700;
}

/* ===== LAYOUT FORM ===== */
.form-grid {
    display: grid;
    gap: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* ===== FORM ELEMENTS ===== */
.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-label.required::after {
    content: ' *';
    color: var(--primary-color);
}

.form-input, .form-select, .form-textarea {
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--surface);
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

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

/* ===== ADOPTION TYPE SELECTOR ===== */
.adoption-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 8px;
}

.adoption-type-option {
    position: relative;
}

.adoption-type-radio {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.adoption-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--surface);
}

.adoption-type-radio:checked + .adoption-type-card {
    border-color: var(--primary-color);
    background: rgba(249, 115, 22, 0.05);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.adoption-type-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
}

.adoption-type-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.adoption-type-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ===== IMAGE UPLOAD ===== */
.image-upload-area {
    border: 3px dashed var(--border);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--surface-light);
}

.image-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(249, 115, 22, 0.05);
}

.image-upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(249, 115, 22, 0.1);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.upload-text {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.image-preview {
    position: relative;
    max-width: 300px;
    margin: 16px auto;
}

.preview-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== CROPPER INTEGRATION ===== */
.cropper-container {
    position: relative !important;
}

.crop-message {
    pointer-events: none;
    background-color: var(--primary-color) !important;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: opacity 0.5s ease;
}

.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

#imageToEdit {
    cursor: pointer;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

#imageToEdit:hover {
    opacity: 0.9;
}

.crop-controls {
    text-align: center;
    margin-top: 10px;
}

/* ===== CHECKBOX GROUP ===== */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-item:hover {
    border-color: var(--primary-light);
    background: rgba(249, 115, 22, 0.05);
}

.checkbox-item input:checked + .checkbox-content {
    color: var(--primary-color);
}

.checkbox-item input:checked {
    border-color: var(--primary-color);
}

/* ===== BUTTONS ===== */
.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    justify-content: center;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.btn-primary:hover {
    background: var(--gradient-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border);
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ===== MESSAGES ===== */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin-top: 8px;
    font-size: 0.9rem;
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    margin-top: 8px;
    font-size: 0.9rem;
}

/* ===== LOADING STATE ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--primary-color);
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== MAP STYLES ===== */
.suggestions {
    border: 1px solid var(--border);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    background: var(--surface);
    position: relative;
    z-index: 1000;
    border-radius: 0 0 8px 8px;
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: rgba(249, 115, 22, 0.1);
}

.suggestion-item.no-results,
.suggestion-item.error {
    color: var(--text-secondary);
    font-style: italic;
    cursor: default;
}

.suggestion-item.error {
    color: #ef4444;
}

.map-instructions {
    background: var(--adoption-light);
    border: 1px solid var(--adoption-accent);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.map-instructions strong {
    color: var(--primary-color);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .create-form {
        margin: 16px;
        padding: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .adoption-type-selector {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes formSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.create-form {
    animation: formSlideUp 0.4s ease;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .create-form {
        animation: none;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
}
